diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index 8042847..a59832e 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -1198,3 +1198,47 @@
 
 	return ofnode_read_string(node, prop_name);
 }
+
+ofnode ofnode_get_phy_node(ofnode node)
+{
+	/* DT node properties that reference a PHY node */
+	static const char * const phy_handle_str[] = {
+		"phy-handle", "phy", "phy-device",
+	};
+	struct ofnode_phandle_args args = {
+		.node = ofnode_null()
+	};
+	int i;
+
+	assert(ofnode_valid(node));
+
+	for (i = 0; i < ARRAY_SIZE(phy_handle_str); i++)
+		if (!ofnode_parse_phandle_with_args(node, phy_handle_str[i],
+						    NULL, 0, 0, &args))
+			break;
+
+	return args.node;
+}
+
+phy_interface_t ofnode_read_phy_mode(ofnode node)
+{
+	const char *mode;
+	int i;
+
+	assert(ofnode_valid(node));
+
+	mode = ofnode_read_string(node, "phy-mode");
+	if (!mode)
+		mode = ofnode_read_string(node, "phy-connection-type");
+
+	if (!mode)
+		return PHY_INTERFACE_MODE_NA;
+
+	for (i = 0; i < PHY_INTERFACE_MODE_MAX; i++)
+		if (!strcmp(mode, phy_interface_strings[i]))
+			return i;
+
+	debug("%s: Invalid PHY interface '%s'\n", __func__, mode);
+
+	return PHY_INTERFACE_MODE_NA;
+}
diff --git a/drivers/core/read.c b/drivers/core/read.c
index 31f9e78..c73508d 100644
--- a/drivers/core/read.c
+++ b/drivers/core/read.c
@@ -398,3 +398,13 @@
 {
 	return ofnode_decode_display_timing(dev_ofnode(dev), index, config);
 }
+
+ofnode dev_get_phy_node(const struct udevice *dev)
+{
+	return ofnode_get_phy_node(dev_ofnode(dev));
+}
+
+phy_interface_t dev_read_phy_mode(const struct udevice *dev)
+{
+	return ofnode_read_phy_mode(dev_ofnode(dev));
+}
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index a6171a7..347fe8a 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -191,6 +191,11 @@
 	  This driver supports the XGMAC in Calxeda Highbank and Midway
 	  machines.
 
+config DRIVER_DM9000
+	bool "Davicom DM9000 controller driver"
+	help
+	  The Davicom DM9000 parallel bus external ethernet interface chip.
+
 config DWC_ETH_QOS
 	bool "Synopsys DWC Ethernet QOS device support"
 	depends on DM_ETH
diff --git a/drivers/net/ag7xxx.c b/drivers/net/ag7xxx.c
index 632ab3c..a16c998 100644
--- a/drivers/net/ag7xxx.c
+++ b/drivers/net/ag7xxx.c
@@ -1254,7 +1254,6 @@
 static int ag7xxx_eth_of_to_plat(struct udevice *dev)
 {
 	struct eth_pdata *pdata = dev_get_plat(dev);
-	const char *phy_mode;
 	int ret;
 
 	pdata->iobase = dev_read_addr(dev);
@@ -1265,13 +1264,9 @@
 	if (ret <= 0)
 		return ret;
 
-	phy_mode = fdt_getprop(gd->fdt_blob, ret, "phy-mode", NULL);
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (pdata->phy_interface == -1) {
-		debug("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 
 	return 0;
 }
diff --git a/drivers/net/altera_tse.c b/drivers/net/altera_tse.c
index eb4cd96..912d28f 100644
--- a/drivers/net/altera_tse.c
+++ b/drivers/net/altera_tse.c
@@ -435,11 +435,11 @@
 	if (priv->phyaddr)
 		mask = 1 << priv->phyaddr;
 
-	phydev = phy_find_by_mask(priv->bus, mask, priv->interface);
+	phydev = phy_find_by_mask(priv->bus, mask);
 	if (!phydev)
 		return -ENODEV;
 
-	phy_connect_dev(phydev, dev);
+	phy_connect_dev(phydev, dev, priv->interface);
 
 	phydev->supported &= PHY_GBIT_FEATURES;
 	phydev->advertising = phydev->supported;
@@ -676,17 +676,10 @@
 static int altera_tse_of_to_plat(struct udevice *dev)
 {
 	struct eth_pdata *pdata = dev_get_plat(dev);
-	const char *phy_mode;
 
-	pdata->phy_interface = -1;
-	phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode",
-			       NULL);
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (pdata->phy_interface == -1) {
-		debug("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 
 	return 0;
 }
diff --git a/drivers/net/bcm6348-eth.c b/drivers/net/bcm6348-eth.c
index 06e0dd7..5317173 100644
--- a/drivers/net/bcm6348-eth.c
+++ b/drivers/net/bcm6348-eth.c
@@ -415,7 +415,6 @@
 	struct eth_pdata *pdata = dev_get_plat(dev);
 	struct bcm6348_eth_priv *priv = dev_get_priv(dev);
 	struct ofnode_phandle_args phy;
-	const char *phy_mode;
 	int ret, i;
 
 	/* get base address */
@@ -425,11 +424,8 @@
 	pdata->iobase = (phys_addr_t) priv->base;
 
 	/* get phy mode */
-	pdata->phy_interface = PHY_INTERFACE_MODE_NONE;
-	phy_mode = dev_read_string(dev, "phy-mode");
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (pdata->phy_interface == PHY_INTERFACE_MODE_NONE)
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -ENODEV;
 
 	/* get phy */
diff --git a/drivers/net/bcmgenet.c b/drivers/net/bcmgenet.c
index 6783956..4e1f8ed 100644
--- a/drivers/net/bcmgenet.c
+++ b/drivers/net/bcmgenet.c
@@ -526,8 +526,6 @@
 	}
 	phydev->advertising = phydev->supported;
 
-	phy_connect_dev(phydev, dev);
-
 	priv->phydev = phydev;
 	phy_config(priv->phydev);
 
@@ -690,20 +688,14 @@
 	struct eth_pdata *pdata = dev_get_plat(dev);
 	struct bcmgenet_eth_priv *priv = dev_get_priv(dev);
 	struct ofnode_phandle_args phy_node;
-	const char *phy_mode;
 	int ret;
 
 	pdata->iobase = dev_read_addr(dev);
 
 	/* Get phy mode from DT */
-	pdata->phy_interface = -1;
-	phy_mode = dev_read_string(dev, "phy-mode");
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (pdata->phy_interface == -1) {
-		debug("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 
 	ret = dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0,
 					 &phy_node);
diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 5aaac60..1584b9e 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -914,21 +914,15 @@
 	struct dw_eth_dev *priv = dev_get_priv(dev);
 #endif
 	struct eth_pdata *pdata = &dw_pdata->eth_pdata;
-	const char *phy_mode;
 #if CONFIG_IS_ENABLED(DM_GPIO)
 	int reset_flags = GPIOD_IS_OUT;
 #endif
 	int ret = 0;
 
 	pdata->iobase = dev_read_addr(dev);
-	pdata->phy_interface = -1;
-	phy_mode = dev_read_string(dev, "phy-mode");
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (pdata->phy_interface == -1) {
-		debug("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 
 	pdata->max_speed = dev_read_u32_default(dev, "max-speed", 0);
 
diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
index 4f062e9..78ce536 100644
--- a/drivers/net/dm9000x.c
+++ b/drivers/net/dm9000x.c
@@ -1,86 +1,66 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
-  dm9000.c: Version 1.2 12/15/2003
-
-	A Davicom DM9000 ISA NIC fast Ethernet driver for Linux.
-	Copyright (C) 1997  Sten Wang
-
-  (C)Copyright 1997-1998 DAVICOM Semiconductor,Inc. All Rights Reserved.
-
-V0.11	06/20/2001	REG_0A bit3=1, default enable BP with DA match
-	06/22/2001	Support DM9801 progrmming
-			E3: R25 = ((R24 + NF) & 0x00ff) | 0xf000
-			E4: R25 = ((R24 + NF) & 0x00ff) | 0xc200
-		R17 = (R17 & 0xfff0) | NF + 3
-			E5: R25 = ((R24 + NF - 3) & 0x00ff) | 0xc200
-		R17 = (R17 & 0xfff0) | NF
-
-v1.00			modify by simon 2001.9.5
-			change for kernel 2.4.x
-
-v1.1   11/09/2001	fix force mode bug
-
-v1.2   03/18/2003       Weilun Huang <weilun_huang@davicom.com.tw>:
-			Fixed phy reset.
-			Added tx/rx 32 bit mode.
-			Cleaned up for kernel merge.
-
---------------------------------------
-
-       12/15/2003       Initial port to u-boot by
-			Sascha Hauer <saschahauer@web.de>
-
-       06/03/2008	Remy Bohmer <linux@bohmer.net>
-			- Fixed the driver to work with DM9000A.
-			  (check on ISR receive status bit before reading the
-			  FIFO as described in DM9000 programming guide and
-			  application notes)
-			- Added autodetect of databus width.
-			- Made debug code compile again.
-			- Adapt eth_send such that it matches the DM9000*
-			  application notes. Needed to make it work properly
-			  for DM9000A.
-			- Adapted reset procedure to match DM9000 application
-			  notes (i.e. double reset)
-			- some minor code cleanups
-			These changes are tested with DM9000{A,EP,E} together
-			with a 200MHz Atmel AT91SAM9261 core
-
-TODO: external MII is not functional, only internal at the moment.
-*/
+ *   dm9000.c: Version 1.2 12/15/2003
+ *
+ *	A Davicom DM9000 ISA NIC fast Ethernet driver for Linux.
+ *	Copyright (C) 1997  Sten Wang
+ *
+ *   (C)Copyright 1997-1998 DAVICOM Semiconductor,Inc. All Rights Reserved.
+ *
+ * V0.11	06/20/2001	REG_0A bit3=1, default enable BP with DA match
+ *	06/22/2001	Support DM9801 progrmming
+ *			E3: R25 = ((R24 + NF) & 0x00ff) | 0xf000
+ *			E4: R25 = ((R24 + NF) & 0x00ff) | 0xc200
+ *		R17 = (R17 & 0xfff0) | NF + 3
+ *			E5: R25 = ((R24 + NF - 3) & 0x00ff) | 0xc200
+ *		R17 = (R17 & 0xfff0) | NF
+ *
+ * v1.00			modify by simon 2001.9.5
+ *			change for kernel 2.4.x
+ *
+ * v1.1   11/09/2001	fix force mode bug
+ *
+ * v1.2   03/18/2003       Weilun Huang <weilun_huang@davicom.com.tw>:
+ *			Fixed phy reset.
+ *			Added tx/rx 32 bit mode.
+ *			Cleaned up for kernel merge.
+ *
+ * --------------------------------------
+ *
+ *        12/15/2003       Initial port to u-boot by
+ *			Sascha Hauer <saschahauer@web.de>
+ *
+ *        06/03/2008	Remy Bohmer <linux@bohmer.net>
+ *			- Fixed the driver to work with DM9000A.
+ *			  (check on ISR receive status bit before reading the
+ *			  FIFO as described in DM9000 programming guide and
+ *			  application notes)
+ *			- Added autodetect of databus width.
+ *			- Made debug code compile again.
+ *			- Adapt eth_send such that it matches the DM9000*
+ *			  application notes. Needed to make it work properly
+ *			  for DM9000A.
+ *			- Adapted reset procedure to match DM9000 application
+ *			  notes (i.e. double reset)
+ *			- some minor code cleanups
+ *			These changes are tested with DM9000{A,EP,E} together
+ *			with a 200MHz Atmel AT91SAM9261 core
+ *
+ * TODO: external MII is not functional, only internal at the moment.
+ */
 
 #include <common.h>
 #include <command.h>
+#include <dm.h>
+#include <malloc.h>
 #include <net.h>
 #include <asm/io.h>
-#include <dm9000.h>
 #include <linux/delay.h>
 
 #include "dm9000x.h"
 
-/* Board/System/Debug information/definition ---------------- */
-
-/* #define CONFIG_DM9000_DEBUG */
-
-#ifdef CONFIG_DM9000_DEBUG
-#define DM9000_DBG(fmt,args...) printf(fmt, ##args)
-#define DM9000_DMP_PACKET(func,packet,length)  \
-	do { \
-		int i;							\
-		printf("%s: length: %d\n", func, length);		\
-		for (i = 0; i < length; i++) {				\
-			if (i % 8 == 0)					\
-				printf("\n%s: %02x: ", func, i);	\
-			printf("%02x ", ((unsigned char *) packet)[i]);	\
-		} printf("\n");						\
-	} while(0)
-#else
-#define DM9000_DBG(fmt,args...)
-#define DM9000_DMP_PACKET(func,packet,length)
-#endif
-
 /* Structure/enum declaration ------------------------------- */
-typedef struct board_info {
+struct dm9000_priv {
 	u32 runt_length_counter;	/* counter: RX length < 64byte */
 	u32 long_length_counter;	/* counter: RX length > 1514byte */
 	u32 reset_counter;	/* counter: RESET */
@@ -92,209 +72,261 @@
 	u8 phy_addr;
 	u8 device_wait_reset;	/* device state */
 	unsigned char srom[128];
-	void (*outblk)(volatile void *data_ptr, int count);
-	void (*inblk)(void *data_ptr, int count);
-	void (*rx_status)(u16 *RxStatus, u16 *RxLen);
-	struct eth_device netdev;
-} board_info_t;
-static board_info_t dm9000_info;
-
-
-/* function declaration ------------------------------------- */
-static int dm9000_probe(void);
-static u16 dm9000_phy_read(int);
-static void dm9000_phy_write(int, u16);
-static u8 DM9000_ior(int);
-static void DM9000_iow(int reg, u8 value);
+	void (*outblk)(struct dm9000_priv *db, void *data_ptr, int count);
+	void (*inblk)(struct dm9000_priv *db, void *data_ptr, int count);
+	void (*rx_status)(struct dm9000_priv *db, u16 *rxstatus, u16 *rxlen);
+#ifndef CONFIG_DM_ETH
+	struct eth_device dev;
+#endif
+	void __iomem *base_io;
+	void __iomem *base_data;
+};
 
 /* DM9000 network board routine ---------------------------- */
 #ifndef CONFIG_DM9000_BYTE_SWAPPED
-#define DM9000_outb(d,r) writeb(d, (volatile u8 *)(r))
-#define DM9000_outw(d,r) writew(d, (volatile u16 *)(r))
-#define DM9000_outl(d,r) writel(d, (volatile u32 *)(r))
-#define DM9000_inb(r) readb((volatile u8 *)(r))
-#define DM9000_inw(r) readw((volatile u16 *)(r))
-#define DM9000_inl(r) readl((volatile u32 *)(r))
+#define dm9000_outb(d, r) writeb((d), (r))
+#define dm9000_outw(d, r) writew((d), (r))
+#define dm9000_outl(d, r) writel((d), (r))
+#define dm9000_inb(r) readb(r)
+#define dm9000_inw(r) readw(r)
+#define dm9000_inl(r) readl(r)
 #else
-#define DM9000_outb(d, r) __raw_writeb(d, r)
-#define DM9000_outw(d, r) __raw_writew(d, r)
-#define DM9000_outl(d, r) __raw_writel(d, r)
-#define DM9000_inb(r) __raw_readb(r)
-#define DM9000_inw(r) __raw_readw(r)
-#define DM9000_inl(r) __raw_readl(r)
+#define dm9000_outb(d, r) __raw_writeb(d, r)
+#define dm9000_outw(d, r) __raw_writew(d, r)
+#define dm9000_outl(d, r) __raw_writel(d, r)
+#define dm9000_inb(r) __raw_readb(r)
+#define dm9000_inw(r) __raw_readw(r)
+#define dm9000_inl(r) __raw_readl(r)
 #endif
 
-#ifdef CONFIG_DM9000_DEBUG
-static void
-dump_regs(void)
-{
-	DM9000_DBG("\n");
-	DM9000_DBG("NCR   (0x00): %02x\n", DM9000_ior(0));
-	DM9000_DBG("NSR   (0x01): %02x\n", DM9000_ior(1));
-	DM9000_DBG("TCR   (0x02): %02x\n", DM9000_ior(2));
-	DM9000_DBG("TSRI  (0x03): %02x\n", DM9000_ior(3));
-	DM9000_DBG("TSRII (0x04): %02x\n", DM9000_ior(4));
-	DM9000_DBG("RCR   (0x05): %02x\n", DM9000_ior(5));
-	DM9000_DBG("RSR   (0x06): %02x\n", DM9000_ior(6));
-	DM9000_DBG("ISR   (0xFE): %02x\n", DM9000_ior(DM9000_ISR));
-	DM9000_DBG("\n");
-}
-#endif
-
-static void dm9000_outblk_8bit(volatile void *data_ptr, int count)
+#ifdef DEBUG
+static void dm9000_dump_packet(const char *func, u8 *packet, int length)
 {
 	int i;
+
+	printf("%s: length: %d\n", func, length);
+
+	for (i = 0; i < length; i++) {
+		if (i % 8 == 0)
+			printf("\n%s: %02x: ", func, i);
+		printf("%02x ", packet[i]);
+	}
+
+	printf("\n");
+}
+#else
+static void dm9000_dump_packet(const char *func, u8 *packet, int length) {}
+#endif
+
+static void dm9000_outblk_8bit(struct dm9000_priv *db, void *data_ptr, int count)
+{
+	int i;
+
 	for (i = 0; i < count; i++)
-		DM9000_outb((((u8 *) data_ptr)[i] & 0xff), DM9000_DATA);
+		dm9000_outb((((u8 *)data_ptr)[i] & 0xff), db->base_data);
 }
 
-static void dm9000_outblk_16bit(volatile void *data_ptr, int count)
+static void dm9000_outblk_16bit(struct dm9000_priv *db, void *data_ptr, int count)
 {
 	int i;
 	u32 tmplen = (count + 1) / 2;
 
 	for (i = 0; i < tmplen; i++)
-		DM9000_outw(((u16 *) data_ptr)[i], DM9000_DATA);
+		dm9000_outw(((u16 *)data_ptr)[i], db->base_data);
 }
-static void dm9000_outblk_32bit(volatile void *data_ptr, int count)
+
+static void dm9000_outblk_32bit(struct dm9000_priv *db, void *data_ptr, int count)
 {
 	int i;
 	u32 tmplen = (count + 3) / 4;
 
 	for (i = 0; i < tmplen; i++)
-		DM9000_outl(((u32 *) data_ptr)[i], DM9000_DATA);
+		dm9000_outl(((u32 *)data_ptr)[i], db->base_data);
 }
 
-static void dm9000_inblk_8bit(void *data_ptr, int count)
+static void dm9000_inblk_8bit(struct dm9000_priv *db, void *data_ptr, int count)
 {
 	int i;
+
 	for (i = 0; i < count; i++)
-		((u8 *) data_ptr)[i] = DM9000_inb(DM9000_DATA);
+		((u8 *)data_ptr)[i] = dm9000_inb(db->base_data);
 }
 
-static void dm9000_inblk_16bit(void *data_ptr, int count)
+static void dm9000_inblk_16bit(struct dm9000_priv *db, void *data_ptr, int count)
 {
 	int i;
 	u32 tmplen = (count + 1) / 2;
 
 	for (i = 0; i < tmplen; i++)
-		((u16 *) data_ptr)[i] = DM9000_inw(DM9000_DATA);
+		((u16 *)data_ptr)[i] = dm9000_inw(db->base_data);
 }
-static void dm9000_inblk_32bit(void *data_ptr, int count)
+
+static void dm9000_inblk_32bit(struct dm9000_priv *db, void *data_ptr, int count)
 {
 	int i;
 	u32 tmplen = (count + 3) / 4;
 
 	for (i = 0; i < tmplen; i++)
-		((u32 *) data_ptr)[i] = DM9000_inl(DM9000_DATA);
+		((u32 *)data_ptr)[i] = dm9000_inl(db->base_data);
 }
 
-static void dm9000_rx_status_32bit(u16 *RxStatus, u16 *RxLen)
+static void dm9000_rx_status_32bit(struct dm9000_priv *db, u16 *rxstatus, u16 *rxlen)
 {
 	u32 tmpdata;
 
-	DM9000_outb(DM9000_MRCMD, DM9000_IO);
+	dm9000_outb(DM9000_MRCMD, db->base_io);
 
-	tmpdata = DM9000_inl(DM9000_DATA);
-	*RxStatus = __le16_to_cpu(tmpdata);
-	*RxLen = __le16_to_cpu(tmpdata >> 16);
+	tmpdata = dm9000_inl(db->base_data);
+	*rxstatus = __le16_to_cpu(tmpdata);
+	*rxlen = __le16_to_cpu(tmpdata >> 16);
 }
 
-static void dm9000_rx_status_16bit(u16 *RxStatus, u16 *RxLen)
+static void dm9000_rx_status_16bit(struct dm9000_priv *db, u16 *rxstatus, u16 *rxlen)
 {
-	DM9000_outb(DM9000_MRCMD, DM9000_IO);
+	dm9000_outb(DM9000_MRCMD, db->base_io);
 
-	*RxStatus = __le16_to_cpu(DM9000_inw(DM9000_DATA));
-	*RxLen = __le16_to_cpu(DM9000_inw(DM9000_DATA));
+	*rxstatus = __le16_to_cpu(dm9000_inw(db->base_data));
+	*rxlen = __le16_to_cpu(dm9000_inw(db->base_data));
 }
 
-static void dm9000_rx_status_8bit(u16 *RxStatus, u16 *RxLen)
+static void dm9000_rx_status_8bit(struct dm9000_priv *db, u16 *rxstatus, u16 *rxlen)
 {
-	DM9000_outb(DM9000_MRCMD, DM9000_IO);
+	dm9000_outb(DM9000_MRCMD, db->base_io);
 
-	*RxStatus =
-	    __le16_to_cpu(DM9000_inb(DM9000_DATA) +
-			  (DM9000_inb(DM9000_DATA) << 8));
-	*RxLen =
-	    __le16_to_cpu(DM9000_inb(DM9000_DATA) +
-			  (DM9000_inb(DM9000_DATA) << 8));
+	*rxstatus =
+	    __le16_to_cpu(dm9000_inb(db->base_data) +
+			  (dm9000_inb(db->base_data) << 8));
+	*rxlen =
+	    __le16_to_cpu(dm9000_inb(db->base_data) +
+			  (dm9000_inb(db->base_data) << 8));
 }
 
 /*
-  Search DM9000 board, allocate space and register it
-*/
-int
-dm9000_probe(void)
+ *  Read a byte from I/O port
+ */
+static u8 dm9000_ior(struct dm9000_priv *db, int reg)
+{
+	dm9000_outb(reg, db->base_io);
+	return dm9000_inb(db->base_data);
+}
+
+/*
+ *  Write a byte to I/O port
+ */
+static void dm9000_iow(struct dm9000_priv *db, int reg, u8 value)
+{
+	dm9000_outb(reg, db->base_io);
+	dm9000_outb(value, db->base_data);
+}
+
+/*
+ *  Read a word from phyxcer
+ */
+static u16 dm9000_phy_read(struct dm9000_priv *db, int reg)
+{
+	u16 val;
+
+	/* Fill the phyxcer register into REG_0C */
+	dm9000_iow(db, DM9000_EPAR, DM9000_PHY | reg);
+	dm9000_iow(db, DM9000_EPCR, 0xc);	/* Issue phyxcer read command */
+	udelay(100);			/* Wait read complete */
+	dm9000_iow(db, DM9000_EPCR, 0x0);	/* Clear phyxcer read command */
+	val = (dm9000_ior(db, DM9000_EPDRH) << 8) |
+	      dm9000_ior(db, DM9000_EPDRL);
+
+	/* The read data keeps on REG_0D & REG_0E */
+	debug("%s(0x%x): 0x%x\n", __func__, reg, val);
+	return val;
+}
+
+/*
+ *  Write a word to phyxcer
+ */
+static void dm9000_phy_write(struct dm9000_priv *db, int reg, u16 value)
+{
+	/* Fill the phyxcer register into REG_0C */
+	dm9000_iow(db, DM9000_EPAR, DM9000_PHY | reg);
+
+	/* Fill the written data into REG_0D & REG_0E */
+	dm9000_iow(db, DM9000_EPDRL, (value & 0xff));
+	dm9000_iow(db, DM9000_EPDRH, ((value >> 8) & 0xff));
+	dm9000_iow(db, DM9000_EPCR, 0xa);	/* Issue phyxcer write command */
+	udelay(500);			/* Wait write complete */
+	dm9000_iow(db, DM9000_EPCR, 0x0);	/* Clear phyxcer write command */
+	debug("%s(reg:0x%x, value:0x%x)\n", __func__, reg, value);
+}
+
+/*
+ * Search DM9000 board, allocate space and register it
+ */
+static int dm9000_probe(struct dm9000_priv *db)
 {
 	u32 id_val;
-	id_val = DM9000_ior(DM9000_VIDL);
-	id_val |= DM9000_ior(DM9000_VIDH) << 8;
-	id_val |= DM9000_ior(DM9000_PIDL) << 16;
-	id_val |= DM9000_ior(DM9000_PIDH) << 24;
-	if (id_val == DM9000_ID) {
-		printf("dm9000 i/o: 0x%x, id: 0x%x \n", CONFIG_DM9000_BASE,
-		       id_val);
-		return 0;
-	} else {
-		printf("dm9000 not found at 0x%08x id: 0x%08x\n",
-		       CONFIG_DM9000_BASE, id_val);
+
+	id_val = dm9000_ior(db, DM9000_VIDL);
+	id_val |= dm9000_ior(db, DM9000_VIDH) << 8;
+	id_val |= dm9000_ior(db, DM9000_PIDL) << 16;
+	id_val |= dm9000_ior(db, DM9000_PIDH) << 24;
+	if (id_val != DM9000_ID) {
+		printf("dm9000 not found at 0x%p id: 0x%08x\n",
+		       db->base_io, id_val);
 		return -1;
 	}
+
+	printf("dm9000 i/o: 0x%p, id: 0x%x\n", db->base_io, id_val);
+	return 0;
 }
 
 /* General Purpose dm9000 reset routine */
-static void
-dm9000_reset(void)
+static void dm9000_reset(struct dm9000_priv *db)
 {
-	DM9000_DBG("resetting DM9000\n");
+	debug("resetting DM9000\n");
 
-	/* Reset DM9000,
-	   see DM9000 Application Notes V1.22 Jun 11, 2004 page 29 */
+	/*
+	 * Reset DM9000,
+	 * see DM9000 Application Notes V1.22 Jun 11, 2004 page 29
+	 */
 
 	/* DEBUG: Make all GPIO0 outputs, all others inputs */
-	DM9000_iow(DM9000_GPCR, GPCR_GPIO0_OUT);
+	dm9000_iow(db, DM9000_GPCR, GPCR_GPIO0_OUT);
 	/* Step 1: Power internal PHY by writing 0 to GPIO0 pin */
-	DM9000_iow(DM9000_GPR, 0);
+	dm9000_iow(db, DM9000_GPR, 0);
 	/* Step 2: Software reset */
-	DM9000_iow(DM9000_NCR, (NCR_LBK_INT_MAC | NCR_RST));
+	dm9000_iow(db, DM9000_NCR, (NCR_LBK_INT_MAC | NCR_RST));
 
 	do {
-		DM9000_DBG("resetting the DM9000, 1st reset\n");
+		debug("resetting the DM9000, 1st reset\n");
 		udelay(25); /* Wait at least 20 us */
-	} while (DM9000_ior(DM9000_NCR) & 1);
+	} while (dm9000_ior(db, DM9000_NCR) & 1);
 
-	DM9000_iow(DM9000_NCR, 0);
-	DM9000_iow(DM9000_NCR, (NCR_LBK_INT_MAC | NCR_RST)); /* Issue a second reset */
+	dm9000_iow(db, DM9000_NCR, 0);
+	dm9000_iow(db, DM9000_NCR, (NCR_LBK_INT_MAC | NCR_RST)); /* Issue a second reset */
 
 	do {
-		DM9000_DBG("resetting the DM9000, 2nd reset\n");
+		debug("resetting the DM9000, 2nd reset\n");
 		udelay(25); /* Wait at least 20 us */
-	} while (DM9000_ior(DM9000_NCR) & 1);
+	} while (dm9000_ior(db, DM9000_NCR) & 1);
 
 	/* Check whether the ethernet controller is present */
-	if ((DM9000_ior(DM9000_PIDL) != 0x0) ||
-	    (DM9000_ior(DM9000_PIDH) != 0x90))
+	if ((dm9000_ior(db, DM9000_PIDL) != 0x0) ||
+	    (dm9000_ior(db, DM9000_PIDH) != 0x90))
 		printf("ERROR: resetting DM9000 -> not responding\n");
 }
 
-/* Initialize dm9000 board
-*/
-static int dm9000_init(struct eth_device *dev, struct bd_info *bd)
+/* Initialize dm9000 board */
+static int dm9000_init_common(struct dm9000_priv *db, u8 enetaddr[6])
 {
 	int i, oft, lnk;
 	u8 io_mode;
-	struct board_info *db = &dm9000_info;
-
-	DM9000_DBG("%s\n", __func__);
 
 	/* RESET device */
-	dm9000_reset();
+	dm9000_reset(db);
 
-	if (dm9000_probe() < 0)
+	if (dm9000_probe(db) < 0)
 		return -1;
 
 	/* Auto-detect 8/16/32 bit mode, ISR Bit 6+7 indicate bus width */
-	io_mode = DM9000_ior(DM9000_ISR) >> 6;
+	io_mode = dm9000_ior(db, DM9000_ISR) >> 6;
 
 	switch (io_mode) {
 	case 0x0:  /* 16-bit mode */
@@ -325,46 +357,45 @@
 	}
 
 	/* Program operating register, only internal phy supported */
-	DM9000_iow(DM9000_NCR, 0x0);
+	dm9000_iow(db, DM9000_NCR, 0x0);
 	/* TX Polling clear */
-	DM9000_iow(DM9000_TCR, 0);
+	dm9000_iow(db, DM9000_TCR, 0);
 	/* Less 3Kb, 200us */
-	DM9000_iow(DM9000_BPTR, BPTR_BPHW(3) | BPTR_JPT_600US);
+	dm9000_iow(db, DM9000_BPTR, BPTR_BPHW(3) | BPTR_JPT_600US);
 	/* Flow Control : High/Low Water */
-	DM9000_iow(DM9000_FCTR, FCTR_HWOT(3) | FCTR_LWOT(8));
+	dm9000_iow(db, DM9000_FCTR, FCTR_HWOT(3) | FCTR_LWOT(8));
 	/* SH FIXME: This looks strange! Flow Control */
-	DM9000_iow(DM9000_FCR, 0x0);
+	dm9000_iow(db, DM9000_FCR, 0x0);
 	/* Special Mode */
-	DM9000_iow(DM9000_SMCR, 0);
+	dm9000_iow(db, DM9000_SMCR, 0);
 	/* clear TX status */
-	DM9000_iow(DM9000_NSR, NSR_WAKEST | NSR_TX2END | NSR_TX1END);
+	dm9000_iow(db, DM9000_NSR, NSR_WAKEST | NSR_TX2END | NSR_TX1END);
 	/* Clear interrupt status */
-	DM9000_iow(DM9000_ISR, ISR_ROOS | ISR_ROS | ISR_PTS | ISR_PRS);
+	dm9000_iow(db, DM9000_ISR, ISR_ROOS | ISR_ROS | ISR_PTS | ISR_PRS);
 
-	printf("MAC: %pM\n", dev->enetaddr);
-	if (!is_valid_ethaddr(dev->enetaddr)) {
+	printf("MAC: %pM\n", enetaddr);
+	if (!is_valid_ethaddr(enetaddr))
 		printf("WARNING: Bad MAC address (uninitialized EEPROM?)\n");
-	}
 
 	/* fill device MAC address registers */
 	for (i = 0, oft = DM9000_PAR; i < 6; i++, oft++)
-		DM9000_iow(oft, dev->enetaddr[i]);
+		dm9000_iow(db, oft, enetaddr[i]);
 	for (i = 0, oft = 0x16; i < 8; i++, oft++)
-		DM9000_iow(oft, 0xff);
+		dm9000_iow(db, oft, 0xff);
 
 	/* read back mac, just to be sure */
 	for (i = 0, oft = 0x10; i < 6; i++, oft++)
-		DM9000_DBG("%02x:", DM9000_ior(oft));
-	DM9000_DBG("\n");
+		debug("%02x:", dm9000_ior(db, oft));
+	debug("\n");
 
 	/* Activate DM9000 */
 	/* RX enable */
-	DM9000_iow(DM9000_RCR, RCR_DIS_LONG | RCR_DIS_CRC | RCR_RXEN);
+	dm9000_iow(db, DM9000_RCR, RCR_DIS_LONG | RCR_DIS_CRC | RCR_RXEN);
 	/* Enable TX/RX interrupt mask */
-	DM9000_iow(DM9000_IMR, IMR_PAR);
+	dm9000_iow(db, DM9000_IMR, IMR_PAR);
 
 	i = 0;
-	while (!(dm9000_phy_read(1) & 0x20)) {	/* autonegation complete bit */
+	while (!(dm9000_phy_read(db, 1) & 0x20)) {	/* autonegation complete bit */
 		udelay(1000);
 		i++;
 		if (i == 10000) {
@@ -374,7 +405,7 @@
 	}
 
 	/* see what we've got */
-	lnk = dm9000_phy_read(17) >> 12;
+	lnk = dm9000_phy_read(db, 17) >> 12;
 	printf("operating at ");
 	switch (lnk) {
 	case 1:
@@ -398,241 +429,321 @@
 }
 
 /*
-  Hardware start transmission.
-  Send a packet to media from the upper layer.
-*/
-static int dm9000_send(struct eth_device *netdev, void *packet, int length)
+ * Hardware start transmission.
+ * Send a packet to media from the upper layer.
+ */
+static int dm9000_send_common(struct dm9000_priv *db, void *packet, int length)
 {
 	int tmo;
-	struct board_info *db = &dm9000_info;
 
-	DM9000_DMP_PACKET(__func__ , packet, length);
+	dm9000_dump_packet(__func__, packet, length);
 
-	DM9000_iow(DM9000_ISR, IMR_PTM); /* Clear Tx bit in ISR */
+	dm9000_iow(db, DM9000_ISR, IMR_PTM); /* Clear Tx bit in ISR */
 
 	/* Move data to DM9000 TX RAM */
-	DM9000_outb(DM9000_MWCMD, DM9000_IO); /* Prepare for TX-data */
+	dm9000_outb(DM9000_MWCMD, db->base_io); /* Prepare for TX-data */
 
 	/* push the data to the TX-fifo */
-	(db->outblk)(packet, length);
+	db->outblk(db, packet, length);
 
 	/* Set TX length to DM9000 */
-	DM9000_iow(DM9000_TXPLL, length & 0xff);
-	DM9000_iow(DM9000_TXPLH, (length >> 8) & 0xff);
+	dm9000_iow(db, DM9000_TXPLL, length & 0xff);
+	dm9000_iow(db, DM9000_TXPLH, (length >> 8) & 0xff);
 
 	/* Issue TX polling command */
-	DM9000_iow(DM9000_TCR, TCR_TXREQ); /* Cleared after TX complete */
+	dm9000_iow(db, DM9000_TCR, TCR_TXREQ); /* Cleared after TX complete */
 
 	/* wait for end of transmission */
 	tmo = get_timer(0) + 5 * CONFIG_SYS_HZ;
-	while ( !(DM9000_ior(DM9000_NSR) & (NSR_TX1END | NSR_TX2END)) ||
-		!(DM9000_ior(DM9000_ISR) & IMR_PTM) ) {
+	while (!(dm9000_ior(db, DM9000_NSR) & (NSR_TX1END | NSR_TX2END)) ||
+	       !(dm9000_ior(db, DM9000_ISR) & IMR_PTM)) {
 		if (get_timer(0) >= tmo) {
 			printf("transmission timeout\n");
 			break;
 		}
 	}
-	DM9000_iow(DM9000_ISR, IMR_PTM); /* Clear Tx bit in ISR */
+	dm9000_iow(db, DM9000_ISR, IMR_PTM); /* Clear Tx bit in ISR */
 
-	DM9000_DBG("transmit done\n\n");
+	debug("transmit done\n\n");
 	return 0;
 }
 
 /*
-  Stop the interface.
-  The interface is stopped when it is brought.
-*/
-static void dm9000_halt(struct eth_device *netdev)
+ * Stop the interface.
+ * The interface is stopped when it is brought.
+ */
+static void dm9000_halt_common(struct dm9000_priv *db)
 {
-	DM9000_DBG("%s\n", __func__);
-
-	/* RESET devie */
-	dm9000_phy_write(0, 0x8000);	/* PHY RESET */
-	DM9000_iow(DM9000_GPR, 0x01);	/* Power-Down PHY */
-	DM9000_iow(DM9000_IMR, 0x80);	/* Disable all interrupt */
-	DM9000_iow(DM9000_RCR, 0x00);	/* Disable RX */
+	/* RESET device */
+	dm9000_phy_write(db, 0, 0x8000);	/* PHY RESET */
+	dm9000_iow(db, DM9000_GPR, 0x01);	/* Power-Down PHY */
+	dm9000_iow(db, DM9000_IMR, 0x80);	/* Disable all interrupt */
+	dm9000_iow(db, DM9000_RCR, 0x00);	/* Disable RX */
 }
 
 /*
-  Received a packet and pass to upper layer
-*/
-static int dm9000_rx(struct eth_device *netdev)
+ * Received a packet and pass to upper layer
+ */
+static int dm9000_recv_common(struct dm9000_priv *db, uchar *rdptr)
 {
 	u8 rxbyte;
-	u8 *rdptr = (u8 *)net_rx_packets[0];
-	u16 RxStatus, RxLen = 0;
-	struct board_info *db = &dm9000_info;
+	u16 rxstatus, rxlen = 0;
 
-	/* Check packet ready or not, we must check
-	   the ISR status first for DM9000A */
-	if (!(DM9000_ior(DM9000_ISR) & 0x01)) /* Rx-ISR bit must be set. */
+	/*
+	 * Check packet ready or not, we must check
+	 * the ISR status first for DM9000A
+	 */
+	if (!(dm9000_ior(db, DM9000_ISR) & 0x01)) /* Rx-ISR bit must be set. */
 		return 0;
 
-	DM9000_iow(DM9000_ISR, 0x01); /* clear PR status latched in bit 0 */
+	dm9000_iow(db, DM9000_ISR, 0x01); /* clear PR status latched in bit 0 */
 
 	/* There is _at least_ 1 package in the fifo, read them all */
-	for (;;) {
-		DM9000_ior(DM9000_MRCMDX);	/* Dummy read */
+	dm9000_ior(db, DM9000_MRCMDX);	/* Dummy read */
 
-		/* Get most updated data,
-		   only look at bits 0:1, See application notes DM9000 */
-		rxbyte = DM9000_inb(DM9000_DATA) & 0x03;
+	/*
+	 * Get most updated data,
+	 * only look at bits 0:1, See application notes DM9000
+	 */
+	rxbyte = dm9000_inb(db->base_data) & 0x03;
 
-		/* Status check: this byte must be 0 or 1 */
-		if (rxbyte > DM9000_PKT_RDY) {
-			DM9000_iow(DM9000_RCR, 0x00);	/* Stop Device */
-			DM9000_iow(DM9000_ISR, 0x80);	/* Stop INT request */
-			printf("DM9000 error: status check fail: 0x%x\n",
-				rxbyte);
-			return 0;
-		}
-
-		if (rxbyte != DM9000_PKT_RDY)
-			return 0; /* No packet received, ignore */
-
-		DM9000_DBG("receiving packet\n");
-
-		/* A packet ready now  & Get status/length */
-		(db->rx_status)(&RxStatus, &RxLen);
-
-		DM9000_DBG("rx status: 0x%04x rx len: %d\n", RxStatus, RxLen);
-
-		/* Move data from DM9000 */
-		/* Read received packet from RX SRAM */
-		(db->inblk)(rdptr, RxLen);
-
-		if ((RxStatus & 0xbf00) || (RxLen < 0x40)
-			|| (RxLen > DM9000_PKT_MAX)) {
-			if (RxStatus & 0x100) {
-				printf("rx fifo error\n");
-			}
-			if (RxStatus & 0x200) {
-				printf("rx crc error\n");
-			}
-			if (RxStatus & 0x8000) {
-				printf("rx length error\n");
-			}
-			if (RxLen > DM9000_PKT_MAX) {
-				printf("rx length too big\n");
-				dm9000_reset();
-			}
-		} else {
-			DM9000_DMP_PACKET(__func__ , rdptr, RxLen);
-
-			DM9000_DBG("passing packet to upper layer\n");
-			net_process_received_packet(net_rx_packets[0], RxLen);
-		}
+	/* Status check: this byte must be 0 or 1 */
+	if (rxbyte > DM9000_PKT_RDY) {
+		dm9000_iow(db, DM9000_RCR, 0x00);	/* Stop Device */
+		dm9000_iow(db, DM9000_ISR, 0x80);	/* Stop INT request */
+		printf("DM9000 error: status check fail: 0x%x\n",
+		       rxbyte);
+		return -EINVAL;
 	}
-	return 0;
+
+	if (rxbyte != DM9000_PKT_RDY)
+		return 0; /* No packet received, ignore */
+
+	debug("receiving packet\n");
+
+	/* A packet ready now  & Get status/length */
+	db->rx_status(db, &rxstatus, &rxlen);
+
+	debug("rx status: 0x%04x rx len: %d\n", rxstatus, rxlen);
+
+	/* Move data from DM9000 */
+	/* Read received packet from RX SRAM */
+	db->inblk(db, rdptr, rxlen);
+
+	if (rxstatus & 0xbf00 || rxlen < 0x40 || rxlen > DM9000_PKT_MAX) {
+		if (rxstatus & 0x100)
+			printf("rx fifo error\n");
+		if (rxstatus & 0x200)
+			printf("rx crc error\n");
+		if (rxstatus & 0x8000)
+			printf("rx length error\n");
+		if (rxlen > DM9000_PKT_MAX) {
+			printf("rx length too big\n");
+			dm9000_reset(db);
+		}
+		return -EINVAL;
+	}
+
+	return rxlen;
 }
 
 /*
-  Read a word data from SROM
-*/
+ * Read a word data from SROM
+ */
 #if !defined(CONFIG_DM9000_NO_SROM)
-void dm9000_read_srom_word(int offset, u8 *to)
+static void dm9000_read_srom_word(struct dm9000_priv *db, int offset, u8 *to)
 {
-	DM9000_iow(DM9000_EPAR, offset);
-	DM9000_iow(DM9000_EPCR, 0x4);
-	udelay(8000);
-	DM9000_iow(DM9000_EPCR, 0x0);
-	to[0] = DM9000_ior(DM9000_EPDRL);
-	to[1] = DM9000_ior(DM9000_EPDRH);
+	dm9000_iow(db, DM9000_EPAR, offset);
+	dm9000_iow(db, DM9000_EPCR, 0x4);
+	mdelay(8);
+	dm9000_iow(db, DM9000_EPCR, 0x0);
+	to[0] = dm9000_ior(db, DM9000_EPDRL);
+	to[1] = dm9000_ior(db, DM9000_EPDRH);
 }
 
-void dm9000_write_srom_word(int offset, u16 val)
+static void dm9000_get_enetaddr(struct dm9000_priv *db, u8 *enetaddr)
 {
-	DM9000_iow(DM9000_EPAR, offset);
-	DM9000_iow(DM9000_EPDRH, ((val >> 8) & 0xff));
-	DM9000_iow(DM9000_EPDRL, (val & 0xff));
-	DM9000_iow(DM9000_EPCR, 0x12);
-	udelay(8000);
-	DM9000_iow(DM9000_EPCR, 0);
-}
-#endif
-
-static void dm9000_get_enetaddr(struct eth_device *dev)
-{
-#if !defined(CONFIG_DM9000_NO_SROM)
 	int i;
+
 	for (i = 0; i < 3; i++)
-		dm9000_read_srom_word(i, dev->enetaddr + (2 * i));
+		dm9000_read_srom_word(db, i, enetaddr + (2 * i));
+}
+#else
+static void dm9000_get_enetaddr(struct dm9000_priv *db, u8 *enetaddr) {}
 #endif
+
+#ifndef CONFIG_DM_ETH
+static int dm9000_init(struct eth_device *dev, struct bd_info *bd)
+{
+	struct dm9000_priv *db = container_of(dev, struct dm9000_priv, dev);
+
+	return dm9000_init_common(db, dev->enetaddr);
 }
 
-/*
-   Read a byte from I/O port
-*/
-static u8
-DM9000_ior(int reg)
+static void dm9000_halt(struct eth_device *dev)
 {
-	DM9000_outb(reg, DM9000_IO);
-	return DM9000_inb(DM9000_DATA);
+	struct dm9000_priv *db = container_of(dev, struct dm9000_priv, dev);
+
+	dm9000_halt_common(db);
 }
 
-/*
-   Write a byte to I/O port
-*/
-static void
-DM9000_iow(int reg, u8 value)
+static int dm9000_send(struct eth_device *dev, void *packet, int length)
 {
-	DM9000_outb(reg, DM9000_IO);
-	DM9000_outb(value, DM9000_DATA);
+	struct dm9000_priv *db = container_of(dev, struct dm9000_priv, dev);
+
+	return dm9000_send_common(db, packet, length);
 }
 
-/*
-   Read a word from phyxcer
-*/
-static u16
-dm9000_phy_read(int reg)
+static int dm9000_recv(struct eth_device *dev)
 {
-	u16 val;
+	struct dm9000_priv *db = container_of(dev, struct dm9000_priv, dev);
+	int ret;
 
-	/* Fill the phyxcer register into REG_0C */
-	DM9000_iow(DM9000_EPAR, DM9000_PHY | reg);
-	DM9000_iow(DM9000_EPCR, 0xc);	/* Issue phyxcer read command */
-	udelay(100);			/* Wait read complete */
-	DM9000_iow(DM9000_EPCR, 0x0);	/* Clear phyxcer read command */
-	val = (DM9000_ior(DM9000_EPDRH) << 8) | DM9000_ior(DM9000_EPDRL);
+	ret = dm9000_recv_common(db, net_rx_packets[0]);
+	if (ret > 0)
+		net_process_received_packet(net_rx_packets[0], ret);
 
-	/* The read data keeps on REG_0D & REG_0E */
-	DM9000_DBG("dm9000_phy_read(0x%x): 0x%x\n", reg, val);
-	return val;
-}
-
-/*
-   Write a word to phyxcer
-*/
-static void
-dm9000_phy_write(int reg, u16 value)
-{
-
-	/* Fill the phyxcer register into REG_0C */
-	DM9000_iow(DM9000_EPAR, DM9000_PHY | reg);
-
-	/* Fill the written data into REG_0D & REG_0E */
-	DM9000_iow(DM9000_EPDRL, (value & 0xff));
-	DM9000_iow(DM9000_EPDRH, ((value >> 8) & 0xff));
-	DM9000_iow(DM9000_EPCR, 0xa);	/* Issue phyxcer write command */
-	udelay(500);			/* Wait write complete */
-	DM9000_iow(DM9000_EPCR, 0x0);	/* Clear phyxcer write command */
-	DM9000_DBG("dm9000_phy_write(reg:0x%x, value:0x%x)\n", reg, value);
+	return ret;
 }
 
 int dm9000_initialize(struct bd_info *bis)
 {
-	struct eth_device *dev = &(dm9000_info.netdev);
+	struct dm9000_priv *priv;
+	struct eth_device *dev;
+
+	priv = calloc(1, sizeof(*priv));
+	if (!priv)
+		return -ENOMEM;
+
+	dev = &priv->dev;
+
+	priv->base_io = (void __iomem *)DM9000_IO;
+	priv->base_data = (void __iomem *)DM9000_DATA;
 
 	/* Load MAC address from EEPROM */
-	dm9000_get_enetaddr(dev);
+	dm9000_get_enetaddr(priv, dev->enetaddr);
 
 	dev->init = dm9000_init;
 	dev->halt = dm9000_halt;
 	dev->send = dm9000_send;
-	dev->recv = dm9000_rx;
+	dev->recv = dm9000_recv;
 	strcpy(dev->name, "dm9000");
 
-	eth_register(dev);
+	eth_register(&priv->dev);
 
 	return 0;
 }
+#else	/* ifdef CONFIG_DM_ETH */
+static int dm9000_start(struct udevice *dev)
+{
+	struct dm9000_priv *db = dev_get_priv(dev);
+	struct eth_pdata *pdata = dev_get_plat(dev);
+
+	return dm9000_init_common(db, pdata->enetaddr);
+}
+
+static void dm9000_stop(struct udevice *dev)
+{
+	struct dm9000_priv *db = dev_get_priv(dev);
+
+	dm9000_halt_common(db);
+}
+
+static int dm9000_send(struct udevice *dev, void *packet, int length)
+{
+	struct dm9000_priv *db = dev_get_priv(dev);
+	int ret;
+
+	ret = dm9000_send_common(db, packet, length);
+
+	return ret ? 0 : -ETIMEDOUT;
+}
+
+static int dm9000_recv(struct udevice *dev, int flags, uchar **packetp)
+{
+	struct dm9000_priv *db = dev_get_priv(dev);
+	uchar *data = net_rx_packets[0];
+	int ret;
+
+	ret = dm9000_recv_common(db, data);
+	if (ret)
+		*packetp = (void *)data;
+
+	return ret ? ret : -EAGAIN;
+}
+
+static int dm9000_write_hwaddr(struct udevice *dev)
+{
+	struct dm9000_priv *db = dev_get_priv(dev);
+	struct eth_pdata *pdata = dev_get_plat(dev);
+	int i, oft;
+
+	/* fill device MAC address registers */
+	for (i = 0, oft = DM9000_PAR; i < 6; i++, oft++)
+		dm9000_iow(db, oft, pdata->enetaddr[i]);
+
+	for (i = 0, oft = 0x16; i < 8; i++, oft++)
+		dm9000_iow(db, oft, 0xff);
+
+	/* read back mac, just to be sure */
+	for (i = 0, oft = 0x10; i < 6; i++, oft++)
+		debug("%02x:", dm9000_ior(db, oft));
+
+	debug("\n");
+
+	return 0;
+}
+
+static int dm9000_read_rom_hwaddr(struct udevice *dev)
+{
+	struct dm9000_priv *db = dev_get_priv(dev);
+	struct eth_pdata *pdata = dev_get_plat(dev);
+
+	dm9000_get_enetaddr(db, pdata->enetaddr);
+
+	return !is_valid_ethaddr(pdata->enetaddr);
+}
+
+static int dm9000_bind(struct udevice *dev)
+{
+	return device_set_name(dev, dev->name);
+}
+
+static int dm9000_of_to_plat(struct udevice *dev)
+{
+	struct dm9000_priv *db = dev_get_priv(dev);
+	struct eth_pdata *pdata = dev_get_plat(dev);
+
+	pdata->iobase = dev_read_addr_index(dev, 0);
+	db->base_io = (void __iomem *)pdata->iobase;
+	db->base_data = (void __iomem *)dev_read_addr_index(dev, 1);
+
+	return 0;
+}
+
+static const struct eth_ops dm9000_ops = {
+	.start		= dm9000_start,
+	.stop		= dm9000_stop,
+	.send		= dm9000_send,
+	.recv		= dm9000_recv,
+	.write_hwaddr	= dm9000_write_hwaddr,
+	.read_rom_hwaddr = dm9000_read_rom_hwaddr,
+};
+
+static const struct udevice_id dm9000_ids[] = {
+	{ .compatible = "davicom,dm9000" },
+	{ }
+};
+
+U_BOOT_DRIVER(dm9000) = {
+	.name		= "eth_dm9000",
+	.id		= UCLASS_ETH,
+	.of_match	= dm9000_ids,
+	.bind		= dm9000_bind,
+	.of_to_plat = dm9000_of_to_plat,
+	.ops		= &dm9000_ops,
+	.priv_auto	= sizeof(struct dm9000_priv),
+	.plat_auto	= sizeof(struct eth_pdata),
+	.flags		= DM_FLAG_ALLOC_PRIV_DMA,
+};
+#endif
diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
index ea0c2cf..9d255cf 100644
--- a/drivers/net/dwc_eth_qos.c
+++ b/drivers/net/dwc_eth_qos.c
@@ -270,7 +270,7 @@
 	int config_mac;
 	int config_mac_mdio;
 	unsigned int axi_bus_width;
-	phy_interface_t (*interface)(struct udevice *dev);
+	phy_interface_t (*interface)(const struct udevice *dev);
 	struct eqos_ops *ops;
 };
 
@@ -1682,7 +1682,7 @@
 
 	interface = eqos->config->interface(dev);
 
-	if (interface == PHY_INTERFACE_MODE_NONE) {
+	if (interface == PHY_INTERFACE_MODE_NA) {
 		pr_err("Invalid PHY interface\n");
 		return -EINVAL;
 	}
@@ -1729,21 +1729,7 @@
 	return ret;
 }
 
-static phy_interface_t eqos_get_interface_stm32(struct udevice *dev)
-{
-	const char *phy_mode;
-	phy_interface_t interface = PHY_INTERFACE_MODE_NONE;
-
-	debug("%s(dev=%p):\n", __func__, dev);
-
-	phy_mode = dev_read_prop(dev, "phy-mode", NULL);
-	if (phy_mode)
-		interface = phy_get_interface_by_name(phy_mode);
-
-	return interface;
-}
-
-static phy_interface_t eqos_get_interface_tegra186(struct udevice *dev)
+static phy_interface_t eqos_get_interface_tegra186(const struct udevice *dev)
 {
 	return PHY_INTERFACE_MODE_MII;
 }
@@ -1757,7 +1743,7 @@
 
 	interface = eqos->config->interface(dev);
 
-	if (interface == PHY_INTERFACE_MODE_NONE) {
+	if (interface == PHY_INTERFACE_MODE_NA) {
 		pr_err("Invalid PHY interface\n");
 		return -EINVAL;
 	}
@@ -1766,20 +1752,6 @@
 	return 0;
 }
 
-static phy_interface_t eqos_get_interface_imx(struct udevice *dev)
-{
-	const char *phy_mode;
-	phy_interface_t interface = PHY_INTERFACE_MODE_NONE;
-
-	debug("%s(dev=%p):\n", __func__, dev);
-
-	phy_mode = dev_read_prop(dev, "phy-mode", NULL);
-	if (phy_mode)
-		interface = phy_get_interface_by_name(phy_mode);
-
-	return interface;
-}
-
 static int eqos_remove_resources_tegra186(struct udevice *dev)
 {
 	struct eqos_priv *eqos = dev_get_priv(dev);
@@ -1985,7 +1957,7 @@
 	.config_mac = EQOS_MAC_RXQ_CTRL0_RXQ0EN_ENABLED_AV,
 	.config_mac_mdio = EQOS_MAC_MDIO_ADDRESS_CR_250_300,
 	.axi_bus_width = EQOS_AXI_WIDTH_64,
-	.interface = eqos_get_interface_stm32,
+	.interface = dev_read_phy_mode,
 	.ops = &eqos_stm32_ops
 };
 
@@ -2013,7 +1985,7 @@
 	.config_mac = EQOS_MAC_RXQ_CTRL0_RXQ0EN_ENABLED_DCB,
 	.config_mac_mdio = EQOS_MAC_MDIO_ADDRESS_CR_250_300,
 	.axi_bus_width = EQOS_AXI_WIDTH_64,
-	.interface = eqos_get_interface_imx,
+	.interface = dev_read_phy_mode,
 	.ops = &eqos_imx_ops
 };
 
diff --git a/drivers/net/eth-phy-uclass.c b/drivers/net/eth-phy-uclass.c
index 1f285f7..27b7744 100644
--- a/drivers/net/eth-phy-uclass.c
+++ b/drivers/net/eth-phy-uclass.c
@@ -137,7 +137,7 @@
 	/* search "reset-gpios" in phy node */
 	ret = gpio_request_by_name(dev, "reset-gpios", 0,
 				   &uc_priv->reset_gpio,
-				   GPIOD_IS_OUT);
+				   GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE);
 	if (ret && ret != -ENOENT)
 		return ret;
 
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index 7f146d4..a219aff 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -614,11 +614,11 @@
 	mask = 1 << CONFIG_PHY_ADDR;
 #endif
 
-	phydev = phy_find_by_mask(priv->bus, mask, PHY_INTERFACE_MODE_MII);
+	phydev = phy_find_by_mask(priv->bus, mask);
 	if (!phydev)
 		return -ENODEV;
 
-	phy_connect_dev(phydev, dev);
+	phy_connect_dev(phydev, dev, PHY_INTERFACE_MODE_MII);
 
 	phydev->supported &= PHY_BASIC_FEATURES;
 	phydev->advertising = phydev->supported;
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index e8ebef0..a623a5c 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -1310,20 +1310,13 @@
 	int ret = 0;
 	struct eth_pdata *pdata = dev_get_plat(dev);
 	struct fec_priv *priv = dev_get_priv(dev);
-	const char *phy_mode;
 
 	pdata->iobase = dev_read_addr(dev);
 	priv->eth = (struct ethernet_regs *)pdata->iobase;
 
-	pdata->phy_interface = -1;
-	phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode",
-			       NULL);
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (pdata->phy_interface == -1) {
-		debug("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 
 #ifdef CONFIG_DM_REGULATOR
 	device_get_supply_regulator(dev, "phy-supply", &priv->phy_supply);
@@ -1331,7 +1324,7 @@
 
 #if CONFIG_IS_ENABLED(DM_GPIO)
 	ret = gpio_request_by_name(dev, "phy-reset-gpios", 0,
-				   &priv->phy_reset_gpio, GPIOD_IS_OUT);
+				   &priv->phy_reset_gpio, GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE);
 	if (ret < 0)
 		return 0; /* property is optional, don't return error! */
 
diff --git a/drivers/net/fm/b4860.c b/drivers/net/fm/b4860.c
index 6e3d008..e622d86 100644
--- a/drivers/net/fm/b4860.c
+++ b/drivers/net/fm/b4860.c
@@ -55,7 +55,7 @@
 #endif
 
 	if (is_device_disabled(port))
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	/*B4860 has two 10Gig Mac*/
 	if ((port == FM1_10GEC1 || port == FM1_10GEC2)	&&
@@ -112,7 +112,7 @@
 					 (port == FM1_DTSEC2) ||
 					 (port == FM1_DTSEC3) ||
 					 (port == FM1_DTSEC4))
-					return PHY_INTERFACE_MODE_NONE;
+					return PHY_INTERFACE_MODE_NA;
 			}
 		}
 	}
@@ -131,8 +131,8 @@
 			return PHY_INTERFACE_MODE_SGMII;
 		break;
 	default:
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 	}
 
-	return PHY_INTERFACE_MODE_NONE;
+	return PHY_INTERFACE_MODE_NA;
 }
diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c
index 5e0d0bc..1ffe9e2 100644
--- a/drivers/net/fm/eth.c
+++ b/drivers/net/fm/eth.c
@@ -954,17 +954,6 @@
 	return 0;
 }
 #else /* CONFIG_DM_ETH */
-#ifdef CONFIG_PHYLIB
-phy_interface_t fman_read_sys_if(struct udevice *dev)
-{
-	const char *if_str;
-
-	if_str = ofnode_read_string(dev_ofnode(dev), "phy-connection-type");
-	debug("MAC system interface mode %s\n", if_str);
-
-	return phy_get_interface_by_name(if_str);
-}
-#endif
 
 static int fm_eth_bind(struct udevice *dev)
 {
@@ -1038,7 +1027,7 @@
 	reg = (void *)(uintptr_t)dev_read_addr(dev);
 	fm_eth->mac_type = dev_get_driver_data(dev);
 #ifdef CONFIG_PHYLIB
-	fm_eth->enet_if = fman_read_sys_if(dev);
+	fm_eth->enet_if = dev_read_phy_mode(dev);
 #else
 	fm_eth->enet_if = PHY_INTERFACE_MODE_SGMII;
 	printf("%s: warning - unable to determine interface type\n", __func__);
diff --git a/drivers/net/fm/init.c b/drivers/net/fm/init.c
index 2fed642..af94dab 100644
--- a/drivers/net/fm/init.c
+++ b/drivers/net/fm/init.c
@@ -130,7 +130,7 @@
 
 /*
  * Determine if an interface is actually active based on HW config
- * we expect fman_port_enet_if() to report PHY_INTERFACE_MODE_NONE if
+ * we expect fman_port_enet_if() to report PHY_INTERFACE_MODE_NA if
  * the interface is not active based on HW cfg of the SoC
  */
 void fman_enet_init(void)
@@ -141,7 +141,7 @@
 		phy_interface_t enet_if;
 
 		enet_if = fman_port_enet_if(fm_info[i].port);
-		if (enet_if != PHY_INTERFACE_MODE_NONE) {
+		if (enet_if != PHY_INTERFACE_MODE_NA) {
 			fm_info[i].enabled = 1;
 			fm_info[i].enet_if = enet_if;
 		} else {
@@ -221,12 +221,12 @@
 	int i = fm_port_to_index(port);
 
 	if (i == -1)
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	if (fm_info[i].enabled)
 		return fm_info[i].enet_if;
 
-	return PHY_INTERFACE_MODE_NONE;
+	return PHY_INTERFACE_MODE_NA;
 }
 
 static void
diff --git a/drivers/net/fm/ls1043.c b/drivers/net/fm/ls1043.c
index e1abf8f..cd8376a 100644
--- a/drivers/net/fm/ls1043.c
+++ b/drivers/net/fm/ls1043.c
@@ -54,13 +54,13 @@
 	u32 rcwsr13 = in_be32(&gur->rcwsr[13]);
 
 	if (is_device_disabled(port))
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	if ((port == FM1_10GEC1) && (is_serdes_configured(XFI_FM1_MAC9)))
 		return PHY_INTERFACE_MODE_XGMII;
 
 	if ((port == FM1_DTSEC9) && (is_serdes_configured(XFI_FM1_MAC9)))
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	if (port == FM1_DTSEC3)
 		if ((rcwsr13 & FSL_CHASSIS2_RCWSR13_EC1) ==
@@ -107,5 +107,5 @@
 		break;
 	}
 
-	return PHY_INTERFACE_MODE_NONE;
+	return PHY_INTERFACE_MODE_NA;
 }
diff --git a/drivers/net/fm/ls1046.c b/drivers/net/fm/ls1046.c
index 09df0aa..876f48b 100644
--- a/drivers/net/fm/ls1046.c
+++ b/drivers/net/fm/ls1046.c
@@ -54,19 +54,19 @@
 	u32 rcwsr13 = in_be32(&gur->rcwsr[13]);
 
 	if (is_device_disabled(port))
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	if ((port == FM1_10GEC1) && (is_serdes_configured(XFI_FM1_MAC9)))
 		return PHY_INTERFACE_MODE_XGMII;
 
 	if ((port == FM1_DTSEC9) && (is_serdes_configured(XFI_FM1_MAC9)))
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	if ((port == FM1_10GEC2) && (is_serdes_configured(XFI_FM1_MAC10)))
 		return PHY_INTERFACE_MODE_XGMII;
 
 	if ((port == FM1_DTSEC10) && (is_serdes_configured(XFI_FM1_MAC10)))
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	if (port == FM1_DTSEC3)
 		if ((rcwsr13 & FSL_CHASSIS2_RCWSR13_EC1) ==
@@ -118,5 +118,5 @@
 		break;
 	}
 
-	return PHY_INTERFACE_MODE_NONE;
+	return PHY_INTERFACE_MODE_NA;
 }
diff --git a/drivers/net/fm/p1023.c b/drivers/net/fm/p1023.c
index d4167e4..c9b85fc 100644
--- a/drivers/net/fm/p1023.c
+++ b/drivers/net/fm/p1023.c
@@ -46,7 +46,7 @@
 	u32 pordevsr = in_be32(&gur->pordevsr);
 
 	if (is_device_disabled(port))
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	/* DTSEC1 can be SGMII, RGMII or RMII */
 	if (port == FM1_DTSEC1) {
@@ -68,5 +68,5 @@
 			return PHY_INTERFACE_MODE_RGMII;
 	}
 
-	return PHY_INTERFACE_MODE_NONE;
+	return PHY_INTERFACE_MODE_NA;
 }
diff --git a/drivers/net/fm/p4080.c b/drivers/net/fm/p4080.c
index b78b02d..577ee22 100644
--- a/drivers/net/fm/p4080.c
+++ b/drivers/net/fm/p4080.c
@@ -54,7 +54,7 @@
 	u32 rcwsr11 = in_be32(&gur->rcwsr[11]);
 
 	if (is_device_disabled(port))
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	if ((port == FM1_10GEC1) && (is_serdes_configured(XAUI_FM1)))
 		return PHY_INTERFACE_MODE_XGMII;
@@ -91,8 +91,8 @@
 			return PHY_INTERFACE_MODE_SGMII;
 		break;
 	default:
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 	}
 
-	return PHY_INTERFACE_MODE_NONE;
+	return PHY_INTERFACE_MODE_NA;
 }
diff --git a/drivers/net/fm/p5020.c b/drivers/net/fm/p5020.c
index 8189531..8ecc482 100644
--- a/drivers/net/fm/p5020.c
+++ b/drivers/net/fm/p5020.c
@@ -50,7 +50,7 @@
 	u32 rcwsr11 = in_be32(&gur->rcwsr[11]);
 
 	if (is_device_disabled(port))
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	if ((port == FM1_10GEC1) && (is_serdes_configured(XAUI_FM1)))
 		return PHY_INTERFACE_MODE_XGMII;
@@ -82,8 +82,8 @@
 			return PHY_INTERFACE_MODE_SGMII;
 		break;
 	default:
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 	}
 
-	return PHY_INTERFACE_MODE_NONE;
+	return PHY_INTERFACE_MODE_NA;
 }
diff --git a/drivers/net/fm/p5040.c b/drivers/net/fm/p5040.c
index 38744e7..3a1494d 100644
--- a/drivers/net/fm/p5040.c
+++ b/drivers/net/fm/p5040.c
@@ -56,7 +56,7 @@
 	u32 rcwsr11 = in_be32(&gur->rcwsr[11]);
 
 	if (is_device_disabled(port))
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	if ((port == FM1_10GEC1) && (is_serdes_configured(XAUI_FM1)))
 		return PHY_INTERFACE_MODE_XGMII;
@@ -99,8 +99,8 @@
 			return PHY_INTERFACE_MODE_SGMII;
 		break;
 	default:
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 	}
 
-	return PHY_INTERFACE_MODE_NONE;
+	return PHY_INTERFACE_MODE_NA;
 }
diff --git a/drivers/net/fm/t1024.c b/drivers/net/fm/t1024.c
index 696e74c..7110fb4 100644
--- a/drivers/net/fm/t1024.c
+++ b/drivers/net/fm/t1024.c
@@ -39,7 +39,7 @@
 	u32 rcwsr13 = in_be32(&gur->rcwsr[13]);
 
 	if (is_device_disabled(port))
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	if ((port == FM1_10GEC1) && (is_serdes_configured(XFI_FM1_MAC1)))
 		return PHY_INTERFACE_MODE_XGMII;
@@ -83,5 +83,5 @@
 		break;
 	}
 
-	return PHY_INTERFACE_MODE_NONE;
+	return PHY_INTERFACE_MODE_NA;
 }
diff --git a/drivers/net/fm/t1040.c b/drivers/net/fm/t1040.c
index af4f5c5..192f1c6 100644
--- a/drivers/net/fm/t1040.c
+++ b/drivers/net/fm/t1040.c
@@ -56,8 +56,8 @@
 			return PHY_INTERFACE_MODE_SGMII;
 		break;
 	default:
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 	}
 
-	return PHY_INTERFACE_MODE_NONE;
+	return PHY_INTERFACE_MODE_NA;
 }
diff --git a/drivers/net/fm/t2080.c b/drivers/net/fm/t2080.c
index f4d8d2d..bfbd8de 100644
--- a/drivers/net/fm/t2080.c
+++ b/drivers/net/fm/t2080.c
@@ -47,7 +47,7 @@
 	u32 rcwsr13 = in_be32(&gur->rcwsr[13]);
 
 	if (is_device_disabled(port))
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	if ((port == FM1_10GEC1 || port == FM1_10GEC2) &&
 	    ((is_serdes_configured(XAUI_FM1_MAC9))	||
@@ -85,8 +85,8 @@
 			return PHY_INTERFACE_MODE_SGMII;
 		break;
 	default:
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 	}
 
-	return PHY_INTERFACE_MODE_NONE;
+	return PHY_INTERFACE_MODE_NA;
 }
diff --git a/drivers/net/fm/t4240.c b/drivers/net/fm/t4240.c
index f8e63c3..ba7b862 100644
--- a/drivers/net/fm/t4240.c
+++ b/drivers/net/fm/t4240.c
@@ -61,7 +61,7 @@
 	u32 rcwsr13 = in_be32(&gur->rcwsr[13]);
 
 	if (is_device_disabled(port))
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	if ((port == FM1_10GEC1 || port == FM1_10GEC2) &&
 	    ((is_serdes_configured(XAUI_FM1_MAC9))	||
@@ -73,7 +73,7 @@
 	if ((port == FM1_DTSEC9 || port == FM1_DTSEC10) &&
 	    ((is_serdes_configured(XFI_FM1_MAC9)) ||
 	     (is_serdes_configured(XFI_FM1_MAC10))))
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	if ((port == FM2_10GEC1 || port == FM2_10GEC2) &&
 	    ((is_serdes_configured(XAUI_FM2_MAC9))	||
@@ -166,5 +166,5 @@
 		break;
 	}
 
-	return PHY_INTERFACE_MODE_NONE;
+	return PHY_INTERFACE_MODE_NA;
 }
diff --git a/drivers/net/fsl_enetc.c b/drivers/net/fsl_enetc.c
index 915c7c8..1724f94 100644
--- a/drivers/net/fsl_enetc.c
+++ b/drivers/net/fsl_enetc.c
@@ -260,9 +260,6 @@
 static void enetc_start_pcs(struct udevice *dev)
 {
 	struct enetc_priv *priv = dev_get_priv(dev);
-	const char *if_str;
-
-	priv->if_type = PHY_INTERFACE_MODE_NONE;
 
 	/* register internal MDIO for debug purposes */
 	if (enetc_read_port(priv, ENETC_PCAPR0) & ENETC_PCAPRO_MDIO) {
@@ -279,14 +276,12 @@
 		return;
 	}
 
-	if_str = ofnode_read_string(dev_ofnode(dev), "phy-mode");
-	if (if_str)
-		priv->if_type = phy_get_interface_by_name(if_str);
-	else
+	priv->if_type = dev_read_phy_mode(dev);
+	if (priv->if_type == PHY_INTERFACE_MODE_NA) {
 		enetc_dbg(dev,
 			  "phy-mode property not found, defaulting to SGMII\n");
-	if (priv->if_type < 0)
-		priv->if_type = PHY_INTERFACE_MODE_NONE;
+		priv->if_type = PHY_INTERFACE_MODE_SGMII;
+	}
 
 	switch (priv->if_type) {
 	case PHY_INTERFACE_MODE_SGMII:
diff --git a/drivers/net/ftgmac100.c b/drivers/net/ftgmac100.c
index aa719d2..78779d7 100644
--- a/drivers/net/ftgmac100.c
+++ b/drivers/net/ftgmac100.c
@@ -549,17 +549,12 @@
 {
 	struct eth_pdata *pdata = dev_get_plat(dev);
 	struct ftgmac100_data *priv = dev_get_priv(dev);
-	const char *phy_mode;
 
 	pdata->iobase = dev_read_addr(dev);
-	pdata->phy_interface = -1;
-	phy_mode = dev_read_string(dev, "phy-mode");
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (pdata->phy_interface == -1) {
-		dev_err(dev, "Invalid PHY interface '%s'\n", phy_mode);
+
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 
 	pdata->max_speed = dev_read_u32_default(dev, "max-speed", 0);
 
diff --git a/drivers/net/higmacv300.c b/drivers/net/higmacv300.c
index aa79d6e..1862235 100644
--- a/drivers/net/higmacv300.c
+++ b/drivers/net/higmacv300.c
@@ -561,19 +561,14 @@
 static int higmac_of_to_plat(struct udevice *dev)
 {
 	struct higmac_priv *priv = dev_get_priv(dev);
-	int phyintf = PHY_INTERFACE_MODE_NONE;
-	const char *phy_mode;
 	ofnode phy_node;
 
 	priv->base = dev_remap_addr_index(dev, 0);
 	priv->macif_ctrl = dev_remap_addr_index(dev, 1);
 
-	phy_mode = dev_read_string(dev, "phy-mode");
-	if (phy_mode)
-		phyintf = phy_get_interface_by_name(phy_mode);
-	if (phyintf == PHY_INTERFACE_MODE_NONE)
+	priv->phyintf = dev_read_phy_mode(dev);
+	if (priv->phyintf == PHY_INTERFACE_MODE_NA)
 		return -ENODEV;
-	priv->phyintf = phyintf;
 
 	phy_node = dev_read_subnode(dev, "phy");
 	if (!ofnode_valid(phy_node)) {
diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c
index 725173f..b6f589e 100644
--- a/drivers/net/ldpaa_eth/ldpaa_eth.c
+++ b/drivers/net/ldpaa_eth/ldpaa_eth.c
@@ -1120,31 +1120,14 @@
 	return fdtdec_get_uint(gd->fdt_blob, port_node, "reg", -1);
 }
 
-static const char *ldpaa_eth_get_phy_mode_str(struct udevice *dev)
-{
-	int port_node = dev_of_offset(dev);
-	const char *phy_mode_str;
-
-	phy_mode_str = fdt_getprop(gd->fdt_blob, port_node,
-				   "phy-connection-type", NULL);
-	if (phy_mode_str)
-		return phy_mode_str;
-
-	phy_mode_str = fdt_getprop(gd->fdt_blob, port_node, "phy-mode", NULL);
-	return phy_mode_str;
-}
-
 static int ldpaa_eth_bind(struct udevice *dev)
 {
-	const char *phy_mode_str = NULL;
 	uint32_t dpmac_id;
 	char eth_name[16];
 	int phy_mode = -1;
 
-	phy_mode_str = ldpaa_eth_get_phy_mode_str(dev);
-	if (phy_mode_str)
-		phy_mode = phy_get_interface_by_name(phy_mode_str);
-	if (phy_mode == -1) {
+	phy_mode = dev_read_phy_mode(dev);
+	if (phy_mode == PHY_INTERFACE_MODE_NA) {
 		dev_err(dev, "incorrect phy mode\n");
 		return -EINVAL;
 	}
@@ -1155,7 +1138,8 @@
 		return -EINVAL;
 	}
 
-	sprintf(eth_name, "DPMAC%d@%s", dpmac_id, phy_mode_str);
+	sprintf(eth_name, "DPMAC%d@%s", dpmac_id,
+		phy_string_for_interface(phy_mode));
 	device_set_name(dev, eth_name);
 
 	return 0;
@@ -1164,11 +1148,9 @@
 static int ldpaa_eth_of_to_plat(struct udevice *dev)
 {
 	struct ldpaa_eth_priv *priv = dev_get_priv(dev);
-	const char *phy_mode_str;
 
 	priv->dpmac_id = ldpaa_eth_get_dpmac_id(dev);
-	phy_mode_str = ldpaa_eth_get_phy_mode_str(dev);
-	priv->phy_mode = phy_get_interface_by_name(phy_mode_str);
+	priv->phy_mode = dev_read_phy_mode(dev);
 
 	return 0;
 }
diff --git a/drivers/net/ldpaa_eth/ldpaa_wriop.c b/drivers/net/ldpaa_eth/ldpaa_wriop.c
index 06a284a..adecb81 100644
--- a/drivers/net/ldpaa_eth/ldpaa_wriop.c
+++ b/drivers/net/ldpaa_eth/ldpaa_wriop.c
@@ -16,7 +16,7 @@
 
 __weak phy_interface_t wriop_dpmac_enet_if(int dpmac_id, int lane_prtc)
 {
-	return PHY_INTERFACE_MODE_NONE;
+	return PHY_INTERFACE_MODE_NA;
 }
 
 void wriop_init_dpmac(int sd, int dpmac_id, int lane_prtcl)
@@ -26,10 +26,10 @@
 
 	dpmac_info[dpmac_id].enabled = 0;
 	dpmac_info[dpmac_id].id = 0;
-	dpmac_info[dpmac_id].enet_if = PHY_INTERFACE_MODE_NONE;
+	dpmac_info[dpmac_id].enet_if = PHY_INTERFACE_MODE_NA;
 
 	enet_if = wriop_dpmac_enet_if(dpmac_id, lane_prtcl);
-	if (enet_if != PHY_INTERFACE_MODE_NONE) {
+	if (enet_if != PHY_INTERFACE_MODE_NA) {
 		dpmac_info[dpmac_id].enabled = 1;
 		dpmac_info[dpmac_id].id = dpmac_id;
 		dpmac_info[dpmac_id].enet_if = enet_if;
@@ -183,10 +183,10 @@
 	int i = wriop_dpmac_to_index(dpmac_id);
 
 	if (i == -1)
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	if (dpmac_info[i].enabled)
 		return dpmac_info[i].enet_if;
 
-	return PHY_INTERFACE_MODE_NONE;
+	return PHY_INTERFACE_MODE_NA;
 }
diff --git a/drivers/net/ldpaa_eth/ls1088a.c b/drivers/net/ldpaa_eth/ls1088a.c
index 54cb16e..943113b 100644
--- a/drivers/net/ldpaa_eth/ls1088a.c
+++ b/drivers/net/ldpaa_eth/ls1088a.c
@@ -50,7 +50,7 @@
 	enum srds_prtcl;
 
 	if (is_device_disabled(dpmac_id + 1))
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	switch (lane_prtcl) {
 	case SGMII1:
@@ -66,7 +66,7 @@
 	if (lane_prtcl >= QSGMII_A && lane_prtcl <= QSGMII_B)
 		return PHY_INTERFACE_MODE_QSGMII;
 
-	return PHY_INTERFACE_MODE_NONE;
+	return PHY_INTERFACE_MODE_NA;
 }
 
 void wriop_init_dpmac_qsgmii(int sd, int lane_prtcl)
diff --git a/drivers/net/ldpaa_eth/ls2080a.c b/drivers/net/ldpaa_eth/ls2080a.c
index 49eee04..62e1d6b 100644
--- a/drivers/net/ldpaa_eth/ls2080a.c
+++ b/drivers/net/ldpaa_eth/ls2080a.c
@@ -62,7 +62,7 @@
 	enum srds_prtcl;
 
 	if (is_device_disabled(dpmac_id + 1))
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	if (lane_prtcl >= SGMII1 && lane_prtcl <= SGMII16)
 		return PHY_INTERFACE_MODE_SGMII;
@@ -76,7 +76,7 @@
 	if (lane_prtcl >= QSGMII_A && lane_prtcl <= QSGMII_D)
 		return PHY_INTERFACE_MODE_QSGMII;
 
-	return PHY_INTERFACE_MODE_NONE;
+	return PHY_INTERFACE_MODE_NA;
 }
 
 void wriop_init_dpmac_qsgmii(int sd, int lane_prtcl)
diff --git a/drivers/net/ldpaa_eth/lx2160a.c b/drivers/net/ldpaa_eth/lx2160a.c
index e57f1a1..f0f8ee1 100644
--- a/drivers/net/ldpaa_eth/lx2160a.c
+++ b/drivers/net/ldpaa_eth/lx2160a.c
@@ -58,7 +58,7 @@
 	enum srds_prtcl;
 
 	if (is_device_disabled(dpmac_id))
-		return PHY_INTERFACE_MODE_NONE;
+		return PHY_INTERFACE_MODE_NA;
 
 	if (lane_prtcl >= SGMII1 && lane_prtcl <= SGMII18)
 		return PHY_INTERFACE_MODE_SGMII;
@@ -78,7 +78,7 @@
 	if (lane_prtcl >= _100GE1 && lane_prtcl <= _100GE2)
 		return PHY_INTERFACE_MODE_CAUI4;
 
-	return PHY_INTERFACE_MODE_NONE;
+	return PHY_INTERFACE_MODE_NA;
 }
 
 #ifdef CONFIG_SYS_FSL_HAS_RGMII
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 37eed59..e02a57b 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -1360,17 +1360,11 @@
 	struct eth_pdata *pdata = dev_get_plat(dev);
 	struct macb_device *macb = dev_get_priv(dev);
 	struct ofnode_phandle_args phandle_args;
-	const char *phy_mode;
 	int ret;
 
-	phy_mode = dev_read_prop(dev, "phy-mode", NULL);
-
-	if (phy_mode)
-		macb->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (macb->phy_interface == -1) {
-		debug("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
+	macb->phy_interface = dev_read_phy_mode(dev);
+	if (macb->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 
 	/* Read phyaddr from DT */
 	if (!dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0,
diff --git a/drivers/net/mdio_mux_sandbox.c b/drivers/net/mdio_mux_sandbox.c
index fff6ddb..e1801c1 100644
--- a/drivers/net/mdio_mux_sandbox.c
+++ b/drivers/net/mdio_mux_sandbox.c
@@ -20,7 +20,6 @@
 static int mdio_mux_sandbox_mark_selection(struct udevice *dev, int sel)
 {
 	struct udevice *mdio;
-	struct mdio_ops *ops;
 	int err;
 
 	/*
@@ -30,9 +29,8 @@
 	err = uclass_get_device_by_name(UCLASS_MDIO, "mdio-test", &mdio);
 	if (err)
 		return err;
-	ops = mdio_get_ops(mdio);
-	return ops->write(mdio, SANDBOX_PHY_ADDR, MDIO_DEVAD_NONE,
-			  SANDBOX_PHY_REG_CNT - 1, (u16)sel);
+	return dm_mdio_write(mdio, SANDBOX_PHY_ADDR, MDIO_DEVAD_NONE,
+			     SANDBOX_PHY_REG_CNT - 1, (u16)sel);
 }
 
 static int mdio_mux_sandbox_select(struct udevice *dev, int cur, int sel)
diff --git a/drivers/net/mscc_eswitch/jr2_switch.c b/drivers/net/mscc_eswitch/jr2_switch.c
index d1e5b61..1462b8f 100644
--- a/drivers/net/mscc_eswitch/jr2_switch.c
+++ b/drivers/net/mscc_eswitch/jr2_switch.c
@@ -954,7 +954,7 @@
 
 		phy = phy_connect(priv->ports[i].bus,
 				  priv->ports[i].phy_addr, dev,
-				  PHY_INTERFACE_MODE_NONE);
+				  PHY_INTERFACE_MODE_NA);
 		if (phy)
 			board_phy_config(phy);
 	}
diff --git a/drivers/net/mscc_eswitch/luton_switch.c b/drivers/net/mscc_eswitch/luton_switch.c
index 73c950d..5e4f00c 100644
--- a/drivers/net/mscc_eswitch/luton_switch.c
+++ b/drivers/net/mscc_eswitch/luton_switch.c
@@ -685,7 +685,7 @@
 
 		phy = phy_connect(priv->ports[i].bus,
 				  priv->ports[i].phy_addr, dev,
-				  PHY_INTERFACE_MODE_NONE);
+				  PHY_INTERFACE_MODE_NA);
 		if (phy && i >= MAX_INT_PORT)
 			board_phy_config(phy);
 	}
diff --git a/drivers/net/mscc_eswitch/ocelot_switch.c b/drivers/net/mscc_eswitch/ocelot_switch.c
index d1d0a48..1bf6c42 100644
--- a/drivers/net/mscc_eswitch/ocelot_switch.c
+++ b/drivers/net/mscc_eswitch/ocelot_switch.c
@@ -608,7 +608,7 @@
 
 		phy = phy_connect(priv->ports[i].bus,
 				  priv->ports[i].phy_addr, dev,
-				  PHY_INTERFACE_MODE_NONE);
+				  PHY_INTERFACE_MODE_NA);
 		if (phy && external_bus(priv, i))
 			board_phy_config(phy);
 	}
diff --git a/drivers/net/mscc_eswitch/serval_switch.c b/drivers/net/mscc_eswitch/serval_switch.c
index c4b81f7..38ddba1 100644
--- a/drivers/net/mscc_eswitch/serval_switch.c
+++ b/drivers/net/mscc_eswitch/serval_switch.c
@@ -561,7 +561,7 @@
 
 		phy = phy_connect(priv->ports[i].bus,
 				  priv->ports[i].phy_addr, dev,
-				  PHY_INTERFACE_MODE_NONE);
+				  PHY_INTERFACE_MODE_NA);
 		if (phy)
 			board_phy_config(phy);
 	}
diff --git a/drivers/net/mscc_eswitch/servalt_switch.c b/drivers/net/mscc_eswitch/servalt_switch.c
index f114086..db863c2 100644
--- a/drivers/net/mscc_eswitch/servalt_switch.c
+++ b/drivers/net/mscc_eswitch/servalt_switch.c
@@ -482,7 +482,7 @@
 			continue;
 
 		phy_connect(priv->ports[i].bus, priv->ports[i].phy_addr, dev,
-			    PHY_INTERFACE_MODE_NONE);
+			    PHY_INTERFACE_MODE_NA);
 	}
 
 	return 0;
diff --git a/drivers/net/mt7620-eth.c b/drivers/net/mt7620-eth.c
index 222250d..038cba1 100644
--- a/drivers/net/mt7620-eth.c
+++ b/drivers/net/mt7620-eth.c
@@ -596,7 +596,7 @@
 	case PHY_INTERFACE_MODE_RGMII:
 		ge_mode = MT7620_SYSC_GE_RGMII;
 		break;
-	case PHY_INTERFACE_MODE_NONE:
+	case PHY_INTERFACE_MODE_NA:
 		if (gmac == 2)
 			ge_mode = MT7620_SYSC_GE_ESW_PHY;
 		else
@@ -620,7 +620,7 @@
 {
 	u32 pmcr;
 
-	if (port_cfg->mode == PHY_INTERFACE_MODE_NONE) {
+	if (port_cfg->mode == PHY_INTERFACE_MODE_NA) {
 		if (port == 5) {
 			gsw_write(priv, GSW_PMCR(port), FORCE_MODE);
 			return;
@@ -666,7 +666,7 @@
 {
 	int phy_addr_st, phy_addr_end;
 
-	if (priv->port_cfg[0].mode == PHY_INTERFACE_MODE_NONE)
+	if (priv->port_cfg[0].mode == PHY_INTERFACE_MODE_NA)
 		priv->ephy_num = NUM_FE_PHYS;
 	else
 		priv->ephy_num = NUM_FE_PHYS - 1;
@@ -1048,33 +1048,20 @@
 				     ofnode node)
 {
 	ofnode subnode;
-	const char *str;
-	int mode, speed, ret;
+	int speed, ret;
 	u32 phy_addr;
 
-	str = ofnode_read_string(node, "phy-mode");
-	if (str) {
-		mode = phy_get_interface_by_name(str);
-		if (mode < 0) {
-			dev_err(priv->dev, "mt7620_eth: invalid phy-mode\n");
-			return -EINVAL;
-		}
+	priv->port_cfg[idx].mode = ofnode_read_phy_mode(node);
 
-		switch (mode) {
-		case PHY_INTERFACE_MODE_MII:
-		case PHY_INTERFACE_MODE_RMII:
-		case PHY_INTERFACE_MODE_RGMII:
-		case PHY_INTERFACE_MODE_NONE:
-			break;
-		default:
-			dev_err(priv->dev,
-				"mt7620_eth: unsupported phy-mode\n");
-			return -ENOTSUPP;
-		}
-
-		priv->port_cfg[idx].mode = mode;
-	} else {
-		priv->port_cfg[idx].mode = PHY_INTERFACE_MODE_NONE;
+	switch (priv->port_cfg[idx].mode) {
+	case PHY_INTERFACE_MODE_MII:
+	case PHY_INTERFACE_MODE_RMII:
+	case PHY_INTERFACE_MODE_RGMII:
+	case PHY_INTERFACE_MODE_NA:
+		break;
+	default:
+		dev_err(priv->dev, "mt7620_eth: unsupported phy-mode\n");
+		return -ENOTSUPP;
 	}
 
 	subnode = ofnode_find_subnode(node, "fixed-link");
@@ -1141,14 +1128,14 @@
 		if (ret)
 			return ret;
 	} else {
-		priv->port_cfg[0].mode = PHY_INTERFACE_MODE_NONE;
+		priv->port_cfg[0].mode = PHY_INTERFACE_MODE_NA;
 	}
 
 	subnode = ofnode_find_subnode(dev_ofnode(dev), "port5");
 	if (ofnode_valid(subnode))
 		return mt7620_eth_parse_gsw_port(priv, 1, subnode);
 
-	priv->port_cfg[1].mode = PHY_INTERFACE_MODE_NONE;
+	priv->port_cfg[1].mode = PHY_INTERFACE_MODE_NA;
 	return 0;
 }
 
diff --git a/drivers/net/mtk_eth.c b/drivers/net/mtk_eth.c
index 26f0284..666ddeb 100644
--- a/drivers/net/mtk_eth.c
+++ b/drivers/net/mtk_eth.c
@@ -1447,11 +1447,9 @@
 	priv->gmac_id = dev_read_u32_default(dev, "mediatek,gmac-id", 0);
 
 	/* Interface mode is required */
-	str = dev_read_string(dev, "phy-mode");
-	if (str) {
-		pdata->phy_interface = phy_get_interface_by_name(str);
-		priv->phy_interface = pdata->phy_interface;
-	} else {
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	priv->phy_interface = pdata->phy_interface;
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA) {
 		printf("error: phy-mode is not set\n");
 		return -EINVAL;
 	}
diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c
index 954bf86..bf5ed55 100644
--- a/drivers/net/mvgbe.c
+++ b/drivers/net/mvgbe.c
@@ -993,7 +993,6 @@
 	struct mvgbe_device *dmvgbe = dev_get_priv(dev);
 	void *blob = (void *)gd->fdt_blob;
 	int node = dev_of_offset(dev);
-	const char *phy_mode;
 	int fl_node;
 	int pnode;
 	unsigned long addr;
@@ -1005,10 +1004,8 @@
 					      "marvell,kirkwood-eth-port");
 
 	/* Get phy-mode / phy_interface from DT */
-	phy_mode = fdt_getprop(gd->fdt_blob, pnode, "phy-mode", NULL);
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	else
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		pdata->phy_interface = PHY_INTERFACE_MODE_GMII;
 
 	dmvgbe->phy_interface = pdata->phy_interface;
diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
index 4a4268c..e2ac4d8 100644
--- a/drivers/net/mvneta.c
+++ b/drivers/net/mvneta.c
@@ -1799,20 +1799,13 @@
 static int mvneta_of_to_plat(struct udevice *dev)
 {
 	struct eth_pdata *pdata = dev_get_plat(dev);
-	const char *phy_mode;
 
 	pdata->iobase = dev_read_addr(dev);
 
 	/* Get phy-mode / phy_interface from DT */
-	pdata->phy_interface = -1;
-	phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode",
-			       NULL);
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (pdata->phy_interface == -1) {
-		debug("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 
 	return 0;
 }
diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c
index 4c0a7b0..8c9afdf 100644
--- a/drivers/net/mvpp2.c
+++ b/drivers/net/mvpp2.c
@@ -4786,11 +4786,9 @@
 static int phy_info_parse(struct udevice *dev, struct mvpp2_port *port)
 {
 	int port_node = dev_of_offset(dev);
-	const char *phy_mode_str;
 	int phy_node;
 	u32 id;
 	u32 phyaddr = 0;
-	int phy_mode = -1;
 	int fixed_link = 0;
 	int ret;
 
@@ -4821,10 +4819,8 @@
 		phyaddr = PHY_MAX_ADDR;
 	}
 
-	phy_mode_str = fdt_getprop(gd->fdt_blob, port_node, "phy-mode", NULL);
-	if (phy_mode_str)
-		phy_mode = phy_get_interface_by_name(phy_mode_str);
-	if (phy_mode == -1) {
+	port->phy_interface = dev_read_phy_mode(dev);
+	if (port->phy_interface == PHY_INTERFACE_MODE_NA) {
 		dev_err(dev, "incorrect phy mode\n");
 		return -EINVAL;
 	}
@@ -4847,7 +4843,6 @@
 		port->first_rxq = port->id * rxq_number;
 	else
 		port->first_rxq = port->id * port->priv->max_port_rxqs;
-	port->phy_interface = phy_mode;
 	port->phyaddr = phyaddr;
 
 	return 0;
diff --git a/drivers/net/pch_gbe.c b/drivers/net/pch_gbe.c
index fabcf85..f189524 100644
--- a/drivers/net/pch_gbe.c
+++ b/drivers/net/pch_gbe.c
@@ -416,13 +416,13 @@
 	struct phy_device *phydev;
 	int mask = 0xffffffff;
 
-	phydev = phy_find_by_mask(priv->bus, mask, plat->phy_interface);
+	phydev = phy_find_by_mask(priv->bus, mask);
 	if (!phydev) {
 		printf("pch_gbe: cannot find the phy\n");
 		return -1;
 	}
 
-	phy_connect_dev(phydev, dev);
+	phy_connect_dev(phydev, dev, plat->phy_interface);
 
 	phydev->supported &= PHY_GBIT_FEATURES;
 	phydev->advertising = phydev->supported;
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index d40ce92..33a4b6f 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -68,6 +68,11 @@
 config PHYLIB_10G
 	bool "Generic 10G PHY support"
 
+config PHY_ADIN
+	bool "Analog Devices Industrial Ethernet PHYs"
+	help
+		Add support for configuring RGMII on Analog Devices ADIN PHYs.
+
 menuconfig PHY_AQUANTIA
 	bool "Aquantia Ethernet PHYs support"
 	select PHY_GIGE
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index 67ca4d3..9d87eb2 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -10,6 +10,7 @@
 
 obj-$(CONFIG_PHYLIB) += phy.o
 obj-$(CONFIG_PHYLIB_10G) += generic_10g.o
+obj-$(CONFIG_PHY_ADIN) += adin.o
 obj-$(CONFIG_PHY_AQUANTIA) += aquantia.o
 obj-$(CONFIG_PHY_ATHEROS) += atheros.o
 obj-$(CONFIG_PHY_BROADCOM) += broadcom.o
diff --git a/drivers/net/phy/adin.c b/drivers/net/phy/adin.c
new file mode 100644
index 0000000..cff841a
--- /dev/null
+++ b/drivers/net/phy/adin.c
@@ -0,0 +1,228 @@
+// SPDX-License-Identifier: GPL-2.0+
+/**
+ *  Driver for Analog Devices Industrial Ethernet PHYs
+ *
+ * Copyright 2019 Analog Devices Inc.
+ * Copyright 2022 Variscite Ltd.
+ */
+#include <common.h>
+#include <phy.h>
+#include <linux/bitops.h>
+#include <linux/bitfield.h>
+
+#define PHY_ID_ADIN1300				0x0283bc30
+#define ADIN1300_EXT_REG_PTR			0x10
+#define ADIN1300_EXT_REG_DATA			0x11
+#define ADIN1300_GE_RGMII_CFG			0xff23
+#define ADIN1300_GE_RGMII_RX_MSK		GENMASK(8, 6)
+#define ADIN1300_GE_RGMII_RX_SEL(x)		\
+		FIELD_PREP(ADIN1300_GE_RGMII_RX_MSK, x)
+#define ADIN1300_GE_RGMII_GTX_MSK		GENMASK(5, 3)
+#define ADIN1300_GE_RGMII_GTX_SEL(x)		\
+		FIELD_PREP(ADIN1300_GE_RGMII_GTX_MSK, x)
+#define ADIN1300_GE_RGMII_RXID_EN		BIT(2)
+#define ADIN1300_GE_RGMII_TXID_EN		BIT(1)
+#define ADIN1300_GE_RGMII_EN			BIT(0)
+
+/* RGMII internal delay settings for rx and tx for ADIN1300 */
+#define ADIN1300_RGMII_1_60_NS			0x0001
+#define ADIN1300_RGMII_1_80_NS			0x0002
+#define	ADIN1300_RGMII_2_00_NS			0x0000
+#define	ADIN1300_RGMII_2_20_NS			0x0006
+#define	ADIN1300_RGMII_2_40_NS			0x0007
+
+/**
+ * struct adin_cfg_reg_map - map a config value to aregister value
+ * @cfg		value in device configuration
+ * @reg		value in the register
+ */
+struct adin_cfg_reg_map {
+	int cfg;
+	int reg;
+};
+
+static const struct adin_cfg_reg_map adin_rgmii_delays[] = {
+	{ 1600, ADIN1300_RGMII_1_60_NS },
+	{ 1800, ADIN1300_RGMII_1_80_NS },
+	{ 2000, ADIN1300_RGMII_2_00_NS },
+	{ 2200, ADIN1300_RGMII_2_20_NS },
+	{ 2400, ADIN1300_RGMII_2_40_NS },
+	{ },
+};
+
+static int adin_lookup_reg_value(const struct adin_cfg_reg_map *tbl, int cfg)
+{
+	size_t i;
+
+	for (i = 0; tbl[i].cfg; i++) {
+		if (tbl[i].cfg == cfg)
+			return tbl[i].reg;
+	}
+
+	return -EINVAL;
+}
+
+static u32 adin_get_reg_value(struct phy_device *phydev,
+			      const char *prop_name,
+			      const struct adin_cfg_reg_map *tbl,
+			      u32 dflt)
+{
+	u32 val;
+	int rc;
+
+	ofnode node = phy_get_ofnode(phydev);
+	if (!ofnode_valid(node)) {
+		printf("%s: failed to get node\n", __func__);
+		return -EINVAL;
+	}
+
+	if (ofnode_read_u32(node, prop_name, &val)) {
+		printf("%s: failed to find %s, using default %d\n",
+		       __func__, prop_name, dflt);
+		return dflt;
+	}
+
+	debug("%s: %s = '%d'\n", __func__, prop_name, val);
+
+	rc = adin_lookup_reg_value(tbl, val);
+	if (rc < 0) {
+		printf("%s: Unsupported value %u for %s using default (%u)\n",
+		      __func__, val, prop_name, dflt);
+		return dflt;
+	}
+
+	return rc;
+}
+
+/**
+ * adin_get_phy_mode_override - Get phy-mode override for adin PHY
+ *
+ * The function gets phy-mode string from property 'adi,phy-mode-override'
+ * and return its index in phy_interface_strings table, or -1 in error case.
+ */
+int adin_get_phy_mode_override(struct phy_device *phydev)
+{
+	ofnode node = phy_get_ofnode(phydev);
+	const char *phy_mode_override;
+	const char *prop_phy_mode_override = "adi,phy-mode-override";
+	int override_interface;
+
+	phy_mode_override = ofnode_read_string(node, prop_phy_mode_override);
+	if (!phy_mode_override)
+		return -ENODEV;
+
+	debug("%s: %s = '%s'\n",
+	      __func__, prop_phy_mode_override, phy_mode_override);
+
+	override_interface = phy_get_interface_by_name(phy_mode_override);
+
+	if (override_interface < 0)
+		printf("%s: %s = '%s' is not valid\n",
+		       __func__, prop_phy_mode_override, phy_mode_override);
+
+	return override_interface;
+}
+
+static u16 adin_ext_read(struct phy_device *phydev, const u32 regnum)
+{
+	u16 val;
+
+	phy_write(phydev, MDIO_DEVAD_NONE, ADIN1300_EXT_REG_PTR, regnum);
+	val = phy_read(phydev, MDIO_DEVAD_NONE, ADIN1300_EXT_REG_DATA);
+
+	debug("%s: adin@0x%x 0x%x=0x%x\n", __func__, phydev->addr, regnum, val);
+
+	return val;
+}
+
+static int adin_ext_write(struct phy_device *phydev, const u32 regnum, const u16 val)
+{
+	debug("%s: adin@0x%x 0x%x=0x%x\n", __func__, phydev->addr, regnum, val);
+
+	phy_write(phydev, MDIO_DEVAD_NONE, ADIN1300_EXT_REG_PTR, regnum);
+
+	return phy_write(phydev, MDIO_DEVAD_NONE, ADIN1300_EXT_REG_DATA, val);
+}
+
+static int adin_config_rgmii_mode(struct phy_device *phydev)
+{
+	u16 reg_val;
+	u32 val;
+	int phy_mode_override = adin_get_phy_mode_override(phydev);
+
+	if (phy_mode_override >= 0) {
+		phydev->interface = (phy_interface_t) phy_mode_override;
+	}
+
+	reg_val = adin_ext_read(phydev, ADIN1300_GE_RGMII_CFG);
+
+	if (!phy_interface_is_rgmii(phydev)) {
+		/* Disable RGMII */
+		reg_val &= ~ADIN1300_GE_RGMII_EN;
+		return adin_ext_write(phydev, ADIN1300_GE_RGMII_CFG, reg_val);
+	}
+
+	/* Enable RGMII */
+	reg_val |= ADIN1300_GE_RGMII_EN;
+
+	/* Enable / Disable RGMII RX Delay */
+	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
+	    phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) {
+		reg_val |= ADIN1300_GE_RGMII_RXID_EN;
+
+		val = adin_get_reg_value(phydev, "adi,rx-internal-delay-ps",
+					 adin_rgmii_delays,
+					 ADIN1300_RGMII_2_00_NS);
+		reg_val &= ~ADIN1300_GE_RGMII_RX_MSK;
+		reg_val |= ADIN1300_GE_RGMII_RX_SEL(val);
+	} else {
+		reg_val &= ~ADIN1300_GE_RGMII_RXID_EN;
+	}
+
+	/* Enable / Disable RGMII RX Delay */
+	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
+	    phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) {
+		reg_val |= ADIN1300_GE_RGMII_TXID_EN;
+
+		val = adin_get_reg_value(phydev, "adi,tx-internal-delay-ps",
+					 adin_rgmii_delays,
+					 ADIN1300_RGMII_2_00_NS);
+		reg_val &= ~ADIN1300_GE_RGMII_GTX_MSK;
+		reg_val |= ADIN1300_GE_RGMII_GTX_SEL(val);
+	} else {
+		reg_val &= ~ADIN1300_GE_RGMII_TXID_EN;
+	}
+
+	return adin_ext_write(phydev, ADIN1300_GE_RGMII_CFG, reg_val);
+}
+
+static int adin1300_config(struct phy_device *phydev)
+{
+	int ret;
+
+	printf("ADIN1300 PHY detected at addr %d\n", phydev->addr);
+
+	ret = adin_config_rgmii_mode(phydev);
+
+	if (ret < 0)
+		return ret;
+
+	return genphy_config(phydev);
+}
+
+static struct phy_driver ADIN1300_driver =  {
+	.name = "ADIN1300",
+	.uid = PHY_ID_ADIN1300,
+	.mask = 0xffffffff,
+	.features = PHY_GBIT_FEATURES,
+	.config = adin1300_config,
+	.startup = genphy_startup,
+	.shutdown = genphy_shutdown,
+};
+
+int phy_adin_init(void)
+{
+	phy_register(&ADIN1300_driver);
+
+	return 0;
+}
diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c
index 83075f7..7e950fe 100644
--- a/drivers/net/phy/aquantia.c
+++ b/drivers/net/phy/aquantia.c
@@ -305,7 +305,7 @@
 	u16 syscfg;
 	int cnt;
 	u16 start_rate;
-} aquantia_syscfg[PHY_INTERFACE_MODE_COUNT] = {
+} aquantia_syscfg[PHY_INTERFACE_MODE_MAX] = {
 	[PHY_INTERFACE_MODE_SGMII] =      {0x04b, AQUANTIA_VND1_GSYSCFG_1G,
 					   AQUANTIA_VND1_GSTART_RATE_1G},
 	[PHY_INTERFACE_MODE_2500BASEX]  = {0x144, AQUANTIA_VND1_GSYSCFG_2_5G,
diff --git a/drivers/net/phy/atheros.c b/drivers/net/phy/atheros.c
index f922fec..fa1fe08 100644
--- a/drivers/net/phy/atheros.c
+++ b/drivers/net/phy/atheros.c
@@ -199,7 +199,7 @@
 
 	node = phy_get_ofnode(phydev);
 	if (!ofnode_valid(node))
-		return -EINVAL;
+		return 0;
 
 	priv = malloc(sizeof(*priv));
 	if (!priv)
diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index eada454..3d86263 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -158,7 +158,7 @@
 
 	node = phy_get_ofnode(phydev);
 	if (!ofnode_valid(node))
-		return -EINVAL;
+		return 0;
 
 	/* Optional configuration */
 	ret = ofnode_read_u32(node, "ti,clk-output-sel",
@@ -266,7 +266,7 @@
 static int dp83867_config(struct phy_device *phydev)
 {
 	struct dp83867_private *dp83867;
-	unsigned int val, delay, cfg2;
+	int val, delay, cfg2;
 	int ret, bs;
 
 	dp83867 = (struct dp83867_private *)phydev->priv;
@@ -291,8 +291,11 @@
 
 	if (phy_interface_is_rgmii(phydev)) {
 		val = phy_read(phydev, MDIO_DEVAD_NONE, MII_DP83867_PHYCTRL);
-		if (val < 0)
+		if (val < 0) {
+			ret = val;
 			goto err_out;
+		}
+
 		val &= ~DP83867_PHYCR_FIFO_DEPTH_MASK;
 		val |= (dp83867->fifo_depth << DP83867_PHYCR_FIFO_DEPTH_SHIFT);
 
diff --git a/drivers/net/phy/ethernet_id.c b/drivers/net/phy/ethernet_id.c
index 1a78a75..8864f99 100644
--- a/drivers/net/phy/ethernet_id.c
+++ b/drivers/net/phy/ethernet_id.c
@@ -12,7 +12,7 @@
 #include <asm/gpio.h>
 
 struct phy_device *phy_connect_phy_id(struct mii_dev *bus, struct udevice *dev,
-				      int phyaddr, phy_interface_t interface)
+				      int phyaddr)
 {
 	struct phy_device *phydev;
 	struct ofnode_phandle_args phandle_args;
@@ -68,7 +68,7 @@
 	}
 
 	id =  vendor << 16 | device;
-	phydev = phy_device_create(bus, phyaddr, id, false, interface);
+	phydev = phy_device_create(bus, phyaddr, id, false);
 	if (phydev)
 		phydev->node = node;
 
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 3672262..1121b99 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -490,6 +490,9 @@
 #ifdef CONFIG_MV88E61XX_SWITCH
 	phy_mv88e61xx_init();
 #endif
+#ifdef CONFIG_PHY_ADIN
+	phy_adin_init();
+#endif
 #ifdef CONFIG_PHY_AQUANTIA
 	phy_aquantia_init();
 #endif
@@ -635,18 +638,17 @@
 	return err;
 }
 
-static struct phy_driver *generic_for_interface(phy_interface_t interface)
+static struct phy_driver *generic_for_phy(struct phy_device *phydev)
 {
 #ifdef CONFIG_PHYLIB_10G
-	if (is_10g_interface(interface))
+	if (phydev->is_c45)
 		return &gen10g_driver;
 #endif
 
 	return &genphy_driver;
 }
 
-static struct phy_driver *get_phy_driver(struct phy_device *phydev,
-					 phy_interface_t interface)
+static struct phy_driver *get_phy_driver(struct phy_device *phydev)
 {
 	struct list_head *entry;
 	int phy_id = phydev->phy_id;
@@ -659,12 +661,11 @@
 	}
 
 	/* If we made it here, there's no driver for this PHY */
-	return generic_for_interface(interface);
+	return generic_for_phy(phydev);
 }
 
 struct phy_device *phy_device_create(struct mii_dev *bus, int addr,
-				     u32 phy_id, bool is_c45,
-				     phy_interface_t interface)
+				     u32 phy_id, bool is_c45)
 {
 	struct phy_device *dev;
 
@@ -683,7 +684,7 @@
 
 	dev->duplex = -1;
 	dev->link = 0;
-	dev->interface = interface;
+	dev->interface = PHY_INTERFACE_MODE_NA;
 
 #ifdef CONFIG_DM_ETH
 	dev->node = ofnode_null();
@@ -696,7 +697,7 @@
 	dev->is_c45 = is_c45;
 	dev->bus = bus;
 
-	dev->drv = get_phy_driver(dev, interface);
+	dev->drv = get_phy_driver(dev);
 
 	if (phy_probe(dev)) {
 		printf("%s, PHY probe failed\n", __func__);
@@ -745,8 +746,7 @@
 }
 
 static struct phy_device *create_phy_by_mask(struct mii_dev *bus,
-					     uint phy_mask, int devad,
-					     phy_interface_t interface)
+					     uint phy_mask, int devad)
 {
 	u32 phy_id = 0xffffffff;
 	bool is_c45;
@@ -767,8 +767,7 @@
 		/* If the PHY ID is mostly f's, we didn't find anything */
 		if (r == 0 && (phy_id & 0x1fffffff) != 0x1fffffff) {
 			is_c45 = (devad == MDIO_DEVAD_NONE) ? false : true;
-			return phy_device_create(bus, addr, phy_id, is_c45,
-						 interface);
+			return phy_device_create(bus, addr, phy_id, is_c45);
 		}
 next:
 		phy_mask &= ~(1 << addr);
@@ -777,25 +776,22 @@
 }
 
 static struct phy_device *search_for_existing_phy(struct mii_dev *bus,
-						  uint phy_mask,
-						  phy_interface_t interface)
+						  uint phy_mask)
 {
 	/* If we have one, return the existing device, with new interface */
 	while (phy_mask) {
 		int addr = ffs(phy_mask) - 1;
 
-		if (bus->phymap[addr]) {
-			bus->phymap[addr]->interface = interface;
+		if (bus->phymap[addr])
 			return bus->phymap[addr];
-		}
+
 		phy_mask &= ~(1 << addr);
 	}
 	return NULL;
 }
 
 static struct phy_device *get_phy_device_by_mask(struct mii_dev *bus,
-						 uint phy_mask,
-						 phy_interface_t interface)
+						 uint phy_mask)
 {
 	struct phy_device *phydev;
 	int devad[] = {
@@ -811,13 +807,12 @@
 	int i, devad_cnt;
 
 	devad_cnt = sizeof(devad)/sizeof(int);
-	phydev = search_for_existing_phy(bus, phy_mask, interface);
+	phydev = search_for_existing_phy(bus, phy_mask);
 	if (phydev)
 		return phydev;
 	/* try different access clauses  */
 	for (i = 0; i < devad_cnt; i++) {
-		phydev = create_phy_by_mask(bus, phy_mask,
-					    devad[i], interface);
+		phydev = create_phy_by_mask(bus, phy_mask, devad[i]);
 		if (IS_ERR(phydev))
 			return NULL;
 		if (phydev)
@@ -845,10 +840,9 @@
  * Description: Reads the ID registers of the PHY at @addr on the
  *   @bus, then allocates and returns the phy_device to represent it.
  */
-static struct phy_device *get_phy_device(struct mii_dev *bus, int addr,
-					 phy_interface_t interface)
+static struct phy_device *get_phy_device(struct mii_dev *bus, int addr)
 {
-	return get_phy_device_by_mask(bus, 1 << addr, interface);
+	return get_phy_device_by_mask(bus, 1 << addr);
 }
 
 int phy_reset(struct phy_device *phydev)
@@ -862,7 +856,7 @@
 
 #ifdef CONFIG_PHYLIB_10G
 	/* If it's 10G, we need to issue reset through one of the MMDs */
-	if (is_10g_interface(phydev->interface)) {
+	if (phydev->is_c45) {
 		if (!phydev->mmds)
 			gen10g_discover_mmds(phydev);
 
@@ -907,18 +901,12 @@
 	struct mii_dev *bus = miiphy_get_dev_by_name(devname);
 	struct phy_device *phydev;
 
-	/*
-	 * miiphy_reset was only used on standard PHYs, so we'll fake it here.
-	 * If later code tries to connect with the right interface, this will
-	 * be corrected by get_phy_device in phy_connect()
-	 */
-	phydev = get_phy_device(bus, addr, PHY_INTERFACE_MODE_MII);
+	phydev = get_phy_device(bus, addr);
 
 	return phy_reset(phydev);
 }
 
-struct phy_device *phy_find_by_mask(struct mii_dev *bus, uint phy_mask,
-				    phy_interface_t interface)
+struct phy_device *phy_find_by_mask(struct mii_dev *bus, uint phy_mask)
 {
 	/* Reset the bus */
 	if (bus->reset) {
@@ -928,13 +916,15 @@
 		mdelay(15);
 	}
 
-	return get_phy_device_by_mask(bus, phy_mask, interface);
+	return get_phy_device_by_mask(bus, phy_mask);
 }
 
 #ifdef CONFIG_DM_ETH
-void phy_connect_dev(struct phy_device *phydev, struct udevice *dev)
+void phy_connect_dev(struct phy_device *phydev, struct udevice *dev,
+		     phy_interface_t interface)
 #else
-void phy_connect_dev(struct phy_device *phydev, struct eth_device *dev)
+void phy_connect_dev(struct phy_device *phydev, struct eth_device *dev,
+		     phy_interface_t interface)
 #endif
 {
 	/* Soft Reset the PHY */
@@ -945,13 +935,14 @@
 		       phydev->dev->name, dev->name);
 	}
 	phydev->dev = dev;
-	debug("%s connected to %s\n", dev->name, phydev->drv->name);
+	phydev->interface = interface;
+	debug("%s connected to %s mode %s\n", dev->name, phydev->drv->name,
+	      phy_string_for_interface(interface));
 }
 
 #ifdef CONFIG_PHY_XILINX_GMII2RGMII
 static struct phy_device *phy_connect_gmii2rgmii(struct mii_dev *bus,
-						 struct udevice *dev,
-						 phy_interface_t interface)
+						 struct udevice *dev)
 {
 	struct phy_device *phydev = NULL;
 	ofnode node;
@@ -960,8 +951,7 @@
 		node = ofnode_by_compatible(node, "xlnx,gmii-to-rgmii-1.0");
 		if (ofnode_valid(node)) {
 			phydev = phy_device_create(bus, 0,
-						   PHY_GMII2RGMII_ID, false,
-						   interface);
+						   PHY_GMII2RGMII_ID, false);
 			if (phydev)
 				phydev->node = node;
 			break;
@@ -985,41 +975,31 @@
  */
 struct phy_device *fixed_phy_create(ofnode node)
 {
-	phy_interface_t interface = PHY_INTERFACE_MODE_NONE;
 	struct phy_device *phydev;
-	const char *if_str;
 	ofnode subnode;
 
-	if_str = ofnode_read_string(node, "phy-mode");
-	if (!if_str) {
-		if_str = ofnode_read_string(node, "phy-interface-type");
-	}
-	if (if_str) {
-		interface = phy_get_interface_by_name(if_str);
-	}
-
 	subnode = ofnode_find_subnode(node, "fixed-link");
 	if (!ofnode_valid(subnode)) {
 		return NULL;
 	}
 
-	phydev = phy_device_create(NULL, 0, PHY_FIXED_ID, false, interface);
+	phydev = phy_device_create(NULL, 0, PHY_FIXED_ID, false);
 	if (phydev)
 		phydev->node = subnode;
 
+	phydev->interface = ofnode_read_phy_mode(node);
+
 	return phydev;
 }
 
 static struct phy_device *phy_connect_fixed(struct mii_dev *bus,
-					    struct udevice *dev,
-					    phy_interface_t interface)
+					    struct udevice *dev)
 {
 	ofnode node = dev_ofnode(dev), subnode;
 	struct phy_device *phydev = NULL;
 
 	if (ofnode_phy_is_fixed_link(node, &subnode)) {
-		phydev = phy_device_create(bus, 0, PHY_FIXED_ID,
-					   false, interface);
+		phydev = phy_device_create(bus, 0, PHY_FIXED_ID, false);
 		if (phydev)
 			phydev->node = subnode;
 	}
@@ -1042,29 +1022,29 @@
 	uint mask = (addr >= 0) ? (1 << addr) : 0xffffffff;
 
 #ifdef CONFIG_PHY_FIXED
-	phydev = phy_connect_fixed(bus, dev, interface);
+	phydev = phy_connect_fixed(bus, dev);
 #endif
 
 #ifdef CONFIG_PHY_NCSI
 	if (!phydev)
-		phydev = phy_device_create(bus, 0, PHY_NCSI_ID, false, interface);
+		phydev = phy_device_create(bus, 0, PHY_NCSI_ID, false);
 #endif
 
 #ifdef CONFIG_PHY_ETHERNET_ID
 	if (!phydev)
-		phydev = phy_connect_phy_id(bus, dev, addr, interface);
+		phydev = phy_connect_phy_id(bus, dev, addr);
 #endif
 
 #ifdef CONFIG_PHY_XILINX_GMII2RGMII
 	if (!phydev)
-		phydev = phy_connect_gmii2rgmii(bus, dev, interface);
+		phydev = phy_connect_gmii2rgmii(bus, dev);
 #endif
 
 	if (!phydev)
-		phydev = phy_find_by_mask(bus, mask, interface);
+		phydev = phy_find_by_mask(bus, mask);
 
 	if (phydev)
-		phy_connect_dev(phydev, dev);
+		phy_connect_dev(phydev, dev, interface);
 	else
 		printf("Could not get PHY for %s: addr %d\n", bus->name, addr);
 	return phydev;
@@ -1102,18 +1082,6 @@
 	return 0;
 }
 
-int phy_get_interface_by_name(const char *str)
-{
-	int i;
-
-	for (i = 0; i < PHY_INTERFACE_MODE_COUNT; i++) {
-		if (!strcmp(str, phy_interface_strings[i]))
-			return i;
-	}
-
-	return -1;
-}
-
 /**
  * phy_modify - Convenience function for modifying a given PHY register
  * @phydev: the phy_device struct
diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c
index 635c057..7376283 100644
--- a/drivers/net/phy/xilinx_gmii2rgmii.c
+++ b/drivers/net/phy/xilinx_gmii2rgmii.c
@@ -26,6 +26,11 @@
 
 	debug("%s\n", __func__);
 
+	if (phydev->interface != PHY_INTERFACE_MODE_GMII) {
+		printf("Incorrect interface type\n");
+		return -EINVAL;
+	}
+
 	if (!ofnode_valid(node))
 		return -EINVAL;
 
@@ -37,13 +42,13 @@
 
 	ext_phyaddr = ofnode_read_u32_default(phandle.node, "reg", -1);
 	ext_phydev = phy_find_by_mask(phydev->bus,
-				      1 << ext_phyaddr,
-				      PHY_INTERFACE_MODE_RGMII);
+				      1 << ext_phyaddr);
 	if (!ext_phydev) {
 		printf("%s, No external phy device found\n", __func__);
 		return -EINVAL;
 	}
 
+	ext_phydev->interface = PHY_INTERFACE_MODE_RGMII;
 	ext_phydev->node = phandle.node;
 	phydev->priv = ext_phydev;
 
@@ -114,11 +119,6 @@
 {
 	debug("%s\n", __func__);
 
-	if (phydev->interface != PHY_INTERFACE_MODE_GMII) {
-		printf("Incorrect interface type\n");
-		return -EINVAL;
-	}
-
 	phydev->flags |= PHY_FLAG_BROKEN_RESET;
 
 	return 0;
diff --git a/drivers/net/pic32_eth.c b/drivers/net/pic32_eth.c
index 5a678d1..1333a3a 100644
--- a/drivers/net/pic32_eth.c
+++ b/drivers/net/pic32_eth.c
@@ -534,7 +534,6 @@
 {
 	struct eth_pdata *pdata = dev_get_plat(dev);
 	struct pic32eth_dev *priv = dev_get_priv(dev);
-	const char *phy_mode;
 	void __iomem *iobase;
 	fdt_addr_t addr;
 	fdt_size_t size;
@@ -550,15 +549,9 @@
 	pdata->iobase = (phys_addr_t)addr;
 
 	/* get phy mode */
-	pdata->phy_interface = -1;
-	phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode",
-			       NULL);
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (pdata->phy_interface == -1) {
-		debug("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 
 	/* get phy addr */
 	offset = fdtdec_lookup_phandle(gd->fdt_blob, dev_of_offset(dev),
diff --git a/drivers/net/qe/dm_qe_uec.c b/drivers/net/qe/dm_qe_uec.c
index a12c8cd..8fec1c2 100644
--- a/drivers/net/qe/dm_qe_uec.c
+++ b/drivers/net/qe/dm_qe_uec.c
@@ -1133,19 +1133,12 @@
 static int qe_uec_of_to_plat(struct udevice *dev)
 {
 	struct eth_pdata *pdata = dev_get_plat(dev);
-	const char *phy_mode;
 
 	pdata->iobase = (phys_addr_t)devfdt_get_addr(dev);
 
-	pdata->phy_interface = -1;
-	phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev),
-			       "phy-connection-type", NULL);
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (pdata->phy_interface == -1) {
-		debug("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 
 	return 0;
 }
diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c
index 4078d33..c286805 100644
--- a/drivers/net/ravb.c
+++ b/drivers/net/ravb.c
@@ -319,11 +319,11 @@
 		mdelay(1);
 	}
 
-	phydev = phy_find_by_mask(eth->bus, mask, pdata->phy_interface);
+	phydev = phy_find_by_mask(eth->bus, mask);
 	if (!phydev)
 		return -ENODEV;
 
-	phy_connect_dev(phydev, dev);
+	phy_connect_dev(phydev, dev, pdata->phy_interface);
 
 	eth->phydev = phydev;
 
@@ -674,20 +674,13 @@
 int ravb_of_to_plat(struct udevice *dev)
 {
 	struct eth_pdata *pdata = dev_get_plat(dev);
-	const char *phy_mode;
 	const fdt32_t *cell;
-	int ret = 0;
 
 	pdata->iobase = dev_read_addr(dev);
-	pdata->phy_interface = -1;
-	phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode",
-			       NULL);
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (pdata->phy_interface == -1) {
-		debug("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
+
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 
 	pdata->max_speed = 1000;
 	cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "max-speed", NULL);
@@ -696,7 +689,7 @@
 
 	sprintf(bb_miiphy_buses[0].name, dev->name);
 
-	return ret;
+	return 0;
 }
 
 static const struct udevice_id ravb_ids[] = {
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index 4055f07..1de3ff8 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -762,11 +762,11 @@
 	struct phy_device *phydev;
 	int mask = 0xffffffff;
 
-	phydev = phy_find_by_mask(priv->bus, mask, pdata->phy_interface);
+	phydev = phy_find_by_mask(priv->bus, mask);
 	if (!phydev)
 		return -ENODEV;
 
-	phy_connect_dev(phydev, dev);
+	phy_connect_dev(phydev, dev, pdata->phy_interface);
 
 	port_info->phydev = phydev;
 	phy_config(phydev);
@@ -915,20 +915,13 @@
 int sh_ether_of_to_plat(struct udevice *dev)
 {
 	struct eth_pdata *pdata = dev_get_plat(dev);
-	const char *phy_mode;
 	const fdt32_t *cell;
-	int ret = 0;
 
 	pdata->iobase = dev_read_addr(dev);
-	pdata->phy_interface = -1;
-	phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode",
-			       NULL);
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (pdata->phy_interface == -1) {
-		debug("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
+
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 
 	pdata->max_speed = 1000;
 	cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "max-speed", NULL);
@@ -937,7 +930,7 @@
 
 	sprintf(bb_miiphy_buses[0].name, dev->name);
 
-	return ret;
+	return 0;
 }
 
 static const struct udevice_id sh_ether_ids[] = {
diff --git a/drivers/net/sni_ave.c b/drivers/net/sni_ave.c
index ab51552..58276a4 100644
--- a/drivers/net/sni_ave.c
+++ b/drivers/net/sni_ave.c
@@ -393,11 +393,11 @@
 	struct phy_device *phydev;
 	int mask = GENMASK(31, 0), ret;
 
-	phydev = phy_find_by_mask(priv->bus, mask, priv->phy_mode);
+	phydev = phy_find_by_mask(priv->bus, mask);
 	if (!phydev)
 		return -ENODEV;
 
-	phy_connect_dev(phydev, dev);
+	phy_connect_dev(phydev, dev, priv->phy_mode);
 
 	phydev->supported &= PHY_GBIT_FEATURES;
 	if (priv->max_speed) {
@@ -738,7 +738,6 @@
 	struct eth_pdata *pdata = dev_get_plat(dev);
 	struct ave_private *priv = dev_get_priv(dev);
 	struct ofnode_phandle_args args;
-	const char *phy_mode;
 	const u32 *valp;
 	int ret, nc, nr;
 	const char *name;
@@ -748,15 +747,10 @@
 		return -EINVAL;
 
 	pdata->iobase = dev_read_addr(dev);
-	pdata->phy_interface = -1;
-	phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode",
-			       NULL);
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (pdata->phy_interface == -1) {
-		dev_err(dev, "Invalid PHY interface '%s'\n", phy_mode);
+
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 
 	pdata->max_speed = 0;
 	valp = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "max-speed",
diff --git a/drivers/net/sni_netsec.c b/drivers/net/sni_netsec.c
index 4901321..24caacf 100644
--- a/drivers/net/sni_netsec.c
+++ b/drivers/net/sni_netsec.c
@@ -1029,19 +1029,13 @@
 	struct eth_pdata *pdata = dev_get_plat(dev);
 	struct netsec_priv *priv = dev_get_priv(dev);
 	struct ofnode_phandle_args phandle_args;
-	const char *phy_mode;
 
 	pdata->iobase = dev_read_addr_index(dev, 0);
 	priv->eeprom_base = dev_read_addr_index(dev, 1) - EERPROM_MAP_OFFSET;
 
-	pdata->phy_interface = -1;
-	phy_mode = dev_read_prop(dev, "phy-mode", NULL);
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (pdata->phy_interface == -1) {
-		pr_err("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 
 	if (!dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0,
 					&phandle_args))
diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c
index b23faa2..2220f84 100644
--- a/drivers/net/sun8i_emac.c
+++ b/drivers/net/sun8i_emac.c
@@ -383,8 +383,6 @@
 	if (!phydev)
 		return -ENODEV;
 
-	phy_connect_dev(phydev, dev);
-
 	priv->phydev = phydev;
 	phy_config(priv->phydev);
 
@@ -795,7 +793,6 @@
 	struct sun8i_eth_pdata *sun8i_pdata = dev_get_plat(dev);
 	struct eth_pdata *pdata = &sun8i_pdata->eth_pdata;
 	struct emac_eth_dev *priv = dev_get_priv(dev);
-	const char *phy_mode;
 	const fdt32_t *reg;
 	int node = dev_of_offset(dev);
 	int offset = 0;
@@ -859,16 +856,10 @@
 	}
 	priv->phyaddr = fdtdec_get_int(gd->fdt_blob, offset, "reg", -1);
 
-	phy_mode = fdt_getprop(gd->fdt_blob, node, "phy-mode", NULL);
-
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
+	pdata->phy_interface = dev_read_phy_mode(dev);
 	printf("phy interface%d\n", pdata->phy_interface);
-
-	if (pdata->phy_interface == -1) {
-		debug("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 
 	if (priv->variant == H3_EMAC) {
 		ret = sun8i_handle_internal_phy(dev, priv);
diff --git a/drivers/net/sunxi_emac.c b/drivers/net/sunxi_emac.c
index d15b0ad..8625e49 100644
--- a/drivers/net/sunxi_emac.c
+++ b/drivers/net/sunxi_emac.c
@@ -271,12 +271,11 @@
 	if (ret)
 		return ret;
 
-	priv->phydev = phy_find_by_mask(priv->bus, mask,
-					PHY_INTERFACE_MODE_MII);
+	priv->phydev = phy_find_by_mask(priv->bus, mask);
 	if (!priv->phydev)
 		return -ENODEV;
 
-	phy_connect_dev(priv->phydev, dev);
+	phy_connect_dev(priv->phydev, dev, PHY_INTERFACE_MODE_MII);
 	phy_config(priv->phydev);
 
 	return 0;
diff --git a/drivers/net/ti/am65-cpsw-nuss.c b/drivers/net/ti/am65-cpsw-nuss.c
index 87f51b3..9580fa3 100644
--- a/drivers/net/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ti/am65-cpsw-nuss.c
@@ -602,21 +602,14 @@
 	struct eth_pdata *pdata = dev_get_plat(dev);
 	struct am65_cpsw_priv *priv = dev_get_priv(dev);
 	struct ofnode_phandle_args out_args;
-	const char *phy_mode;
 	int ret = 0;
 
 	dev_read_u32(dev, "reg", &priv->port_id);
 
-	phy_mode = dev_read_string(dev, "phy-mode");
-	if (phy_mode) {
-		pdata->phy_interface =
-				phy_get_interface_by_name(phy_mode);
-		if (pdata->phy_interface == -1) {
-			dev_err(dev, "Invalid PHY mode '%s', port %u\n",
-				phy_mode, priv->port_id);
-			ret = -EINVAL;
-			goto out;
-		}
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA) {
+		dev_err(dev, "Invalid PHY mode, port %u\n", priv->port_id);
+		return -EINVAL;
 	}
 
 	dev_read_u32(dev, "max-speed", (u32 *)&pdata->max_speed);
diff --git a/drivers/net/ti/cpsw.c b/drivers/net/ti/cpsw.c
index 68f4191..8988c21 100644
--- a/drivers/net/ti/cpsw.c
+++ b/drivers/net/ti/cpsw.c
@@ -1194,15 +1194,12 @@
 {
 	struct ofnode_phandle_args out_args;
 	struct cpsw_slave_data *slave_data;
-	const char *phy_mode;
 	u32 phy_id[2];
 	int ret;
 
 	slave_data = &data->slave_data[slave_index];
 
-	phy_mode = ofnode_read_string(subnode, "phy-mode");
-	if (phy_mode)
-		slave_data->phy_if = phy_get_interface_by_name(phy_mode);
+	slave_data->phy_if = ofnode_read_phy_mode(subnode);
 
 	ret = ofnode_parse_phandle_with_args(subnode, "phy-handle",
 					     NULL, 0, 0, &out_args);
@@ -1348,11 +1345,8 @@
 	}
 
 	pdata->phy_interface = data->slave_data[data->active_slave].phy_if;
-	if (pdata->phy_interface == -1) {
-		debug("%s: Invalid PHY interface '%s'\n", __func__,
-		      phy_string_for_interface(pdata->phy_interface));
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 
 	return 0;
 }
diff --git a/drivers/net/ti/keystone_net.c b/drivers/net/ti/keystone_net.c
index 5e8f683..fbec69f 100644
--- a/drivers/net/ti/keystone_net.c
+++ b/drivers/net/ti/keystone_net.c
@@ -23,7 +23,6 @@
 #include <asm/ti-common/keystone_net.h>
 #include <asm/ti-common/keystone_serdes.h>
 #include <asm/arch/psc_defs.h>
-#include <linux/libfdt.h>
 
 #include "cpsw_mdio.h"
 
@@ -91,9 +90,9 @@
 	struct mii_dev			*mdio_bus;
 	int				phy_addr;
 	phy_interface_t			phy_if;
-	int				phy_of_handle;
+	ofnode				phy_ofnode;
 	int				sgmii_link_type;
-	void				*mdio_base;
+	phys_addr_t			mdio_base;
 	struct rx_buff_desc		net_rx_buffs;
 	struct pktdma_cfg		*netcp_pktdma;
 	void				*hd;
@@ -570,7 +569,7 @@
 		 * to re-use the same
 		 */
 		mdio_bus = cpsw_mdio_init("ethernet-mdio",
-					  (u32)priv->mdio_base,
+					  priv->mdio_base,
 					  EMAC_MDIO_CLOCK_FREQ,
 					  EMAC_MDIO_BUS_FREQ);
 		if (!mdio_bus) {
@@ -593,8 +592,8 @@
 		priv->phydev = phy_connect(priv->mdio_bus, priv->phy_addr,
 					   dev, priv->phy_if);
 #ifdef CONFIG_DM_ETH
-	if (priv->phy_of_handle)
-		priv->phydev->node = offset_to_ofnode(priv->phy_of_handle);
+	if (ofnode_valid(priv->phy_ofnode))
+		priv->phydev->node = priv->phy_ofnode;
 #endif
 		phy_config(priv->phydev);
 	}
@@ -621,105 +620,88 @@
 	.write_hwaddr		= ks2_eth_write_hwaddr,
 };
 
-static int ks2_eth_bind_slaves(struct udevice *dev, int gbe, int *gbe_0)
+static int ks2_bind_one_slave(struct udevice *dev, ofnode slave, ofnode *gbe_0)
 {
-	const void *fdt = gd->fdt_blob;
-	struct udevice *sl_dev;
-	int interfaces;
-	int sec_slave;
-	int slave;
-	int ret;
 	char *slave_name;
+	u32 slave_no;
+	int ret;
 
-	interfaces = fdt_subnode_offset(fdt, gbe, "interfaces");
-	fdt_for_each_subnode(slave, fdt, interfaces) {
-		int slave_no;
+	if (ofnode_read_u32(slave, "slave-port", &slave_no))
+		return 0;
 
-		slave_no = fdtdec_get_int(fdt, slave, "slave-port", -ENOENT);
-		if (slave_no == -ENOENT)
-			continue;
-
-		if (slave_no == 0) {
-			/* This is the current eth device */
-			*gbe_0 = slave;
-		} else {
-			/* Slave devices to be registered */
-			slave_name = malloc(20);
-			snprintf(slave_name, 20, "netcp@slave-%d", slave_no);
-			ret = device_bind_driver_to_node(dev, "eth_ks2_sl",
-					slave_name, offset_to_ofnode(slave),
-					&sl_dev);
-			if (ret) {
-				pr_err("ks2_net - not able to bind slave interfaces\n");
-				return ret;
-			}
-		}
+	if (gbe_0 && slave_no == 0) {
+		/* This is the current eth device */
+		*gbe_0 = slave;
+		return 0;
 	}
 
-	sec_slave = fdt_subnode_offset(fdt, gbe, "secondary-slave-ports");
-	fdt_for_each_subnode(slave, fdt, sec_slave) {
-		int slave_no;
+	/* Slave devices to be registered */
+	slave_name = malloc(20);
+	snprintf(slave_name, 20, "netcp@slave-%d", slave_no);
+	ret = device_bind_driver_to_node(dev, "eth_ks2_sl", slave_name, slave,
+					 NULL);
+	if (ret)
+		pr_err("ks2_net - not able to bind slave interfaces\n");
 
-		slave_no = fdtdec_get_int(fdt, slave, "slave-port", -ENOENT);
-		if (slave_no == -ENOENT)
-			continue;
+	return ret;
+}
 
-		/* Slave devices to be registered */
-		slave_name = malloc(20);
-		snprintf(slave_name, 20, "netcp@slave-%d", slave_no);
-		ret = device_bind_driver_to_node(dev, "eth_ks2_sl", slave_name,
-					offset_to_ofnode(slave), &sl_dev);
-		if (ret) {
-			pr_err("ks2_net - not able to bind slave interfaces\n");
+static int ks2_eth_bind_slaves(struct udevice *dev, ofnode gbe, ofnode *gbe_0)
+{
+	ofnode interfaces, sec_slave, slave;
+	int ret;
+
+	interfaces = ofnode_find_subnode(gbe, "interfaces");
+	ofnode_for_each_subnode(slave, interfaces) {
+		ret = ks2_bind_one_slave(dev, slave, gbe_0);
+		if (ret)
 			return ret;
-		}
+	}
+
+	sec_slave = ofnode_find_subnode(gbe, "secondary-slave-ports");
+	ofnode_for_each_subnode(slave, sec_slave) {
+		ret = ks2_bind_one_slave(dev, slave, NULL);
+		if (ret)
+			return ret;
 	}
 
 	return 0;
 }
 
-static int ks2_eth_parse_slave_interface(int netcp, int slave,
+static int ks2_eth_parse_slave_interface(ofnode netcp, ofnode slave,
 					 struct ks2_eth_priv *priv,
 					 struct eth_pdata *pdata)
 {
-	const void *fdt = gd->fdt_blob;
-	int mdio;
-	int phy;
+	struct ofnode_phandle_args dma_args;
+	ofnode phy, mdio;
 	int dma_count;
-	u32 dma_channel[8];
-	const char *phy_mode;
 
-	priv->slave_port = fdtdec_get_int(fdt, slave, "slave-port", -1);
+	priv->slave_port = ofnode_read_s32_default(slave, "slave-port", -1);
 	priv->net_rx_buffs.rx_flow = priv->slave_port * 8;
 
 	/* U-Boot slave port number starts with 1 instead of 0 */
 	priv->slave_port += 1;
 
-	dma_count = fdtdec_get_int_array_count(fdt, netcp,
-					       "ti,navigator-dmas",
-					       dma_channel, 8);
+	dma_count = ofnode_count_phandle_with_args(netcp, "ti,navigator-dmas",
+						   NULL, 1);
+	if (priv->slave_port < dma_count &&
+	    !ofnode_parse_phandle_with_args(netcp, "ti,navigator-dmas", NULL, 1,
+					    priv->slave_port - 1, &dma_args))
+		priv->net_rx_buffs.rx_flow = dma_args.args[0];
 
-	if (dma_count > (2 * priv->slave_port)) {
-		int dma_idx;
+	priv->link_type = ofnode_read_s32_default(slave, "link-interface", -1);
 
-		dma_idx = priv->slave_port * 2 - 1;
-		priv->net_rx_buffs.rx_flow = dma_channel[dma_idx];
-	}
+	phy = ofnode_get_phy_node(slave);
+	priv->phy_ofnode = phy;
+	if (ofnode_valid(phy)) {
+		priv->phy_addr = ofnode_read_s32_default(phy, "reg", -1);
 
-	priv->link_type = fdtdec_get_int(fdt, slave, "link-interface", -1);
-
-	phy = fdtdec_lookup_phandle(fdt, slave, "phy-handle");
-
-	if (phy >= 0) {
-		priv->phy_of_handle = phy;
-		priv->phy_addr = fdtdec_get_int(fdt, phy, "reg", -1);
-
-		mdio = fdt_parent_offset(fdt, phy);
-		if (mdio < 0) {
+		mdio = ofnode_get_parent(phy);
+		if (!ofnode_valid(mdio)) {
 			pr_err("mdio dt not found\n");
 			return -ENODEV;
 		}
-		priv->mdio_base = (void *)fdtdec_get_addr(fdt, mdio, "reg");
+		priv->mdio_base = ofnode_get_addr(mdio);
 	}
 
 	if (priv->link_type == LINK_TYPE_SGMII_MAC_TO_PHY_MODE) {
@@ -728,20 +710,19 @@
 		priv->sgmii_link_type = SGMII_LINK_MAC_PHY;
 		priv->has_mdio = true;
 	} else if (priv->link_type == LINK_TYPE_RGMII_LINK_MAC_PHY) {
-		phy_mode = fdt_getprop(fdt, slave, "phy-mode", NULL);
-		if (phy_mode) {
-			priv->phy_if = phy_get_interface_by_name(phy_mode);
-			if (priv->phy_if != PHY_INTERFACE_MODE_RGMII &&
-			    priv->phy_if != PHY_INTERFACE_MODE_RGMII_ID &&
-			    priv->phy_if != PHY_INTERFACE_MODE_RGMII_RXID &&
-			    priv->phy_if != PHY_INTERFACE_MODE_RGMII_TXID) {
-				pr_err("invalid phy-mode\n");
-				return -EINVAL;
-			}
-		} else {
+		priv->phy_if = ofnode_read_phy_mode(slave);
+		if (priv->phy_if == PHY_INTERFACE_MODE_NA)
 			priv->phy_if = PHY_INTERFACE_MODE_RGMII;
-		}
 		pdata->phy_interface = priv->phy_if;
+
+		if (priv->phy_if != PHY_INTERFACE_MODE_RGMII &&
+		    priv->phy_if != PHY_INTERFACE_MODE_RGMII_ID &&
+		    priv->phy_if != PHY_INTERFACE_MODE_RGMII_RXID &&
+		    priv->phy_if != PHY_INTERFACE_MODE_RGMII_TXID) {
+			pr_err("invalid phy-mode\n");
+			return -EINVAL;
+		}
+
 		priv->has_mdio = true;
 	}
 
@@ -750,23 +731,19 @@
 
 static int ks2_sl_eth_of_to_plat(struct udevice *dev)
 {
+	ofnode slave, interfaces, gbe, netcp_devices, netcp;
 	struct ks2_eth_priv *priv = dev_get_priv(dev);
 	struct eth_pdata *pdata = dev_get_plat(dev);
-	const void *fdt = gd->fdt_blob;
-	int slave = dev_of_offset(dev);
-	int interfaces;
-	int gbe;
-	int netcp_devices;
-	int netcp;
 
-	interfaces = fdt_parent_offset(fdt, slave);
-	gbe = fdt_parent_offset(fdt, interfaces);
-	netcp_devices = fdt_parent_offset(fdt, gbe);
-	netcp = fdt_parent_offset(fdt, netcp_devices);
+	slave = dev_ofnode(dev);
+	interfaces = ofnode_get_parent(slave);
+	gbe = ofnode_get_parent(interfaces);
+	netcp_devices = ofnode_get_parent(gbe);
+	netcp = ofnode_get_parent(netcp_devices);
 
 	ks2_eth_parse_slave_interface(netcp, slave, priv, pdata);
 
-	pdata->iobase = fdtdec_get_addr(fdt, netcp, "reg");
+	pdata->iobase = ofnode_get_addr(netcp);
 
 	return 0;
 }
@@ -775,18 +752,15 @@
 {
 	struct ks2_eth_priv *priv = dev_get_priv(dev);
 	struct eth_pdata *pdata = dev_get_plat(dev);
-	const void *fdt = gd->fdt_blob;
-	int gbe_0 = -ENODEV;
-	int netcp_devices;
-	int gbe;
+	ofnode netcp_devices, gbe, gbe_0;
 
-	netcp_devices = fdt_subnode_offset(fdt, dev_of_offset(dev),
-					   "netcp-devices");
-	gbe = fdt_subnode_offset(fdt, netcp_devices, "gbe");
+	netcp_devices = dev_read_subnode(dev, "netcp-devices");
+	gbe = ofnode_find_subnode(netcp_devices, "gbe");
 
+	gbe_0 = ofnode_null();
 	ks2_eth_bind_slaves(dev, gbe, &gbe_0);
 
-	ks2_eth_parse_slave_interface(dev_of_offset(dev), gbe_0, priv, pdata);
+	ks2_eth_parse_slave_interface(dev_ofnode(dev), gbe_0, priv, pdata);
 
 	pdata->iobase = dev_read_addr(dev);
 
diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index beca886..d69a9ff 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -834,7 +834,6 @@
 	struct ofnode_phandle_args phandle_args;
 	u32 tbiaddr = CONFIG_SYS_TBIPA_VALUE;
 	struct tsec_data *data;
-	const char *phy_mode;
 	ofnode parent, child;
 	fdt_addr_t reg;
 	u32 max_speed;
@@ -894,12 +893,8 @@
 
 	priv->tbiaddr = tbiaddr;
 
-	phy_mode = dev_read_prop(dev, "phy-connection-type", NULL);
-	if (!phy_mode)
-		phy_mode = dev_read_prop(dev, "phy-mode", NULL);
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (pdata->phy_interface == -1)
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		pdata->phy_interface = tsec_get_interface(priv);
 
 	priv->interface = pdata->phy_interface;
diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c
index f21addb..a471573 100644
--- a/drivers/net/xilinx_axi_emac.c
+++ b/drivers/net/xilinx_axi_emac.c
@@ -821,7 +821,6 @@
 	struct eth_pdata *pdata = &plat->eth_pdata;
 	int node = dev_of_offset(dev);
 	int offset = 0;
-	const char *phy_mode;
 
 	pdata->iobase = dev_read_addr(dev);
 	plat->mactype = dev_get_driver_data(dev);
@@ -850,14 +849,9 @@
 			plat->phy_of_handle = offset;
 		}
 
-		phy_mode = fdt_getprop(gd->fdt_blob, node, "phy-mode", NULL);
-		if (phy_mode)
-			pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-		if (pdata->phy_interface == -1) {
-			printf("%s: Invalid PHY interface '%s'\n", __func__,
-			       phy_mode);
+		pdata->phy_interface = dev_read_phy_mode(dev);
+		if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 			return -EINVAL;
-		}
 
 		plat->eth_hasnobuf = fdtdec_get_bool(gd->fdt_blob, node,
 						     "xlnx,eth-hasnobuf");
diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index 4c83ccc..4e8dd4b 100644
--- a/drivers/net/zynq_gem.c
+++ b/drivers/net/zynq_gem.c
@@ -889,7 +889,6 @@
 	struct eth_pdata *pdata = dev_get_plat(dev);
 	struct zynq_gem_priv *priv = dev_get_priv(dev);
 	struct ofnode_phandle_args phandle_args;
-	const char *phy_mode;
 
 	pdata->iobase = (phys_addr_t)dev_read_addr(dev);
 	priv->iobase = (struct zynq_gem_regs *)pdata->iobase;
@@ -923,13 +922,9 @@
 		}
 	}
 
-	phy_mode = dev_read_prop(dev, "phy-mode", NULL);
-	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (pdata->phy_interface == -1) {
-		debug("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
+	pdata->phy_interface = dev_read_phy_mode(dev);
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 	priv->interface = pdata->phy_interface;
 
 	priv->int_pcs = dev_read_bool(dev, "is-internal-pcspma");
